Page MenuHomec4science

dumper.hh
No OneTemporary

File Metadata

Created
Mon, Aug 19, 21:24

dumper.hh

/**
* @file dumper.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
* @author Till Junge <till.junge@epfl.ch>
*
* @date Thu Jul 24 14:21:58 2014
*
* @brief Mother of all dumpers
*
* @section LICENSE
*
* Copyright INRIA and CEA
*
* The LibMultiScale is a C++ parallel framework for the multiscale
* coupling methods dedicated to material simulations. This framework
* provides an API which makes it possible to program coupled simulations
* and integration of already existing codes.
*
* This Project was initiated in a collaboration between INRIA Futurs Bordeaux
* within ScAlApplix team and CEA/DPTA Ile de France.
* The project is now continued at the Ecole Polytechnique Fédérale de Lausanne
* within the LSMS/ENAC laboratory.
*
* This software is governed by the CeCILL-C license under French law and
* abiding by the rules of distribution of free software. You can use,
* modify and/ or redistribute the software under the terms of the CeCILL-C
* license as circulated by CEA, CNRS and INRIA at the following URL
* "http://www.cecill.info".
*
* As a counterpart to the access to the source code and rights to copy,
* modify and redistribute granted by the license, users are provided only
* with a limited warranty and the software's author, the holder of the
* economic rights, and the successive licensors have only limited
* liability.
*
* In this respect, the user's attention is drawn to the risks associated
* with loading, using, modifying and/or developing or reproducing the
* software by the user in light of its specific status of free software,
* that may mean that it is complicated to manipulate, and that also
* therefore means that it is reserved for developers and experienced
* professionals having in-depth computer knowledge. Users are therefore
* encouraged to load and test the software's suitability as regards their
* requirements in conditions enabling the security of their systems and/or
* data to be ensured and, more generally, to use and operate it in the
* same conditions as regards security.
*
* The fact that you are presently reading this means that you have had
* knowledge of the CeCILL-C license and that you accept its terms.
*
*/
#ifndef __LIBMULTISCALE_DUMPER_HH__
#define __LIBMULTISCALE_DUMPER_HH__
/* -------------------------------------------------------------------------- */
#include "dumper_interface.hh"
#include "units.hh"
/* -------------------------------------------------------------------------- */
extern std::string lm_release_info;
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
/** Class Dumper
* templated dumper associated with a given domain
*/
template <typename _Input>
class Dumper : public ComponentLM<_Input, ComponentNull, OUTPUT_NULL>,
public DumperInterface {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
//! Dumper needs a domain to be built
Dumper(const std::string &name, ComponentLMInterface &d);
virtual ~Dumper(){};
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
//! set parameters
virtual void declareParams();
//! construct the name of the files to be generated
void buildNameFile();
//! init stuff
virtual void init();
const std::string &getBaseName();
void manualDump();
private:
virtual void dump(_Input &cont) = 0;
void visit(ComponentLMOut<_Input> &obj);
void dump();
void build();
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected:
//! flag to set if no action required from dumper
bool nothing_to_do_flag;
//! data stored by step
std::map<std::string, std::vector<Real>> by_step_data;
//! unit system in which to output the dump data, not used by all dumpers
UnitSystem dump_unit_system;
//! domain id to apply stimulator on
UInt domain_id;
//! prefix for directory
std::string prefix;
//! base name of the filename
std::string base_name;
};
/* -------------------------------------------------------------------------- */
__END_LIBMULTISCALE__
/* -------------------------------------------------------------------------- */
#include <boost/preprocessor.hpp>
#define BOOST_INSTANCIATE_DUMPER_REF_TEMPLATE(r, data, x) \
template class data<BOOST_PP_TUPLE_ELEM(3, 0, x)::ContainerPoints>; \
template class data<BOOST_PP_TUPLE_ELEM(3, 0, x)::ContainerSubset>;
#define DECLARE_DUMPER_REF(obj, list) \
BOOST_PP_SEQ_FOR_EACH(BOOST_INSTANCIATE_DUMPER_REF_TEMPLATE, obj, list)
#define DECLARE_DUMPER_COMPUTE(obj) template class obj<ComputeInterface>;
#define DECLARE_DUMPER_REFPOINT(obj) \
template class obj<ContainerArray<RefPointData<1>>>; \
template class obj<ContainerArray<RefPointData<2>>>; \
template class obj<ContainerArray<RefPointData<3>>>;
#define DECLARE_DUMPER_GENERIC_MESH(obj) \
template class obj<ContainerGenericMesh<1>>; \
template class obj<ContainerGenericMesh<2>>; \
template class obj<ContainerGenericMesh<3>>;
/* -------------------------------------------------------------------------- */
// file generated by CMake
#include "dumper_real_input_list.hh"
#include "dumper_ref_input_list.hh"
/* -------------------------------------------------------------------------- */
#define LIST_DUMPER LIST_DUMPER_REF_INPUT LIST_DUMPER_REAL_INPUT
/* -------------------------------------------------------------------------- */
#endif /* __LIBMULTISCALE_DUMPER_HH__ */

Event Timeline