Page MenuHomec4science

domain_multiscale.hh
No OneTemporary

File Metadata

Created
Sat, May 17, 03:23

domain_multiscale.hh

/**
* @file domain_multiscale.hh
*
* @author Guillaume Anciaux <guillaume.anciaux@epfl.ch>
*
* @date Wed Jan 15 17:00:43 2014
*
* @brief This is a meta domain whose purpose is to handle other domains
*
* @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_DOMAIN_MULTISCALE_HH__
#define __LIBMULTISCALE_DOMAIN_MULTISCALE_HH__
/* -------------------------------------------------------------------------- */
#include "domain_interface.hh"
//#include "communicator.hh"
#include "id_manager.hh"
/* -------------------------------------------------------------------------- */
__BEGIN_LIBMULTISCALE__
//backward declaration
class FilterManager;
class CouplerManager;
class ActionManager;
class GeometryManager;
/* -------------------------------------------------------------------------- */
// helpful Macros
/* -------------------------------------------------------------------------- */
#define DECLARE_RETURN_REAL_FUNCTION_BYSUM(name) Real name();
#define DECLARE_CALL_TO_SUBFUNCTION(name) void name();
#define DECLARE_CALL_TO_SUBFUNCTION_INTARG(name) void name(UInt arg1);
#define DECLARE_CALL_TO_SUBFUNCTION_REALARG(name) void name(Real arg1);
/* -------------------------------------------------------------------------- */
/**
* Class DomainMultiScale
* domaine generique multiechelle
*/
class DomainMultiScale :
public DomainInterface,
public IDManager<DomainInterface,DomainMultiScale> {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
protected:
friend class IDManager<DomainInterface,DomainMultiScale>;
DomainMultiScale();
virtual ~DomainMultiScale();
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
//! initialization method
void init(){};
//! parse line for creation of a model
UInt parseLineModel(std::stringstream & line);
//! access to potential energy
DECLARE_RETURN_REAL_FUNCTION_BYSUM(getEpot);
//! access to kinetic energy
//DECLARE_RETURN_REAL_FUNCTION_BYSUM(getEcin);
//performw step1
DECLARE_CALL_TO_SUBFUNCTION(performStep1);
//perform step2
DECLARE_CALL_TO_SUBFUNCTION(performStep2);
//perform step3
DECLARE_CALL_TO_SUBFUNCTION(performStep3);
//! function that calls all the stored coupling objects
void coupling(CouplingStage stage);
//! restart from xml file function
void readXMLFile(const std::string & filename){};
//! This method build a full multiscale domain from a config file
UInt build(const std::string & config);
private:
//! generic parser method that is called by the parser object on each red line
ParseResult setParam(const std::string & key, std::stringstream & line);
//! generate mapping from models ID to registered order of the models
void build_indexes();
/* ------------------------------------------------------------------------ */
/* Accessors */
/* ------------------------------------------------------------------------ */
public:
// set current step
DECLARE_CALL_TO_SUBFUNCTION_INTARG(setCurrentStep);
// set timestep
DECLARE_CALL_TO_SUBFUNCTION_REALARG(setTimeStep);
//! get current timestep to a given value
UInt getCurrentStep();
//! get internal timestep to a given value
Real getTimeStep();
//! return a model from its registering order index
DomainInterface * getModelByNumber(UInt i);
//! return the number of registered models
UInt getNbModels();
//! return the global dumper object
ActionManager & getActionManager();
//! return the domain dimensions for this processor
void getSubDomainDimensions(Real * xmin,Real * xmax){LM_TOIMPLEMENT;};
//! return the entire domain dimensions
void getDomainDimensions(Real * xmin,Real * xmax){LM_TOIMPLEMENT;};
//! return the dimension of the domains
UInt getDim(){return Dim;};
//! return product of force by descent direction (for AMELCG)
DECLARE_RETURN_REAL_FUNCTION_BYSUM(getFdotDir);
//! return max of forces (for AMELCG)
Real getFMax();
//! return max of direction (for AMELCG)
Real getDirMax();
//! return norm 2 of forces (for AMELCG)
DECLARE_RETURN_REAL_FUNCTION_BYSUM(getFNorm2);
//! return stuff for AMELCG
DECLARE_RETURN_REAL_FUNCTION_BYSUM(getFdotOldF);
//! update direction AMELCG
DECLARE_CALL_TO_SUBFUNCTION_REALARG(updateDirection);
//! return stuff for AMELCG
DECLARE_CALL_TO_SUBFUNCTION(saveForceVector);
//! displace in descent direction with given magnitude
DECLARE_CALL_TO_SUBFUNCTION_REALARG(displaceTowardsDirection);
/* ------------------------------------------------------------------------ */
/* friends */
/* ------------------------------------------------------------------------ */
friend class Parser;
private:
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
//! mapping between IDs and communication group IDs
std::map<std::string,CommGroup> dom_group;
//! mapping between IDs and registered order
std::vector<std::string> dom_indexes;
//! notificator of the multitimestep (not used at present time)
UInt multi_step;
//! dimension of the multiscale material (should be unified)
UInt Dim;
//! general action manager (stimulators and dumpers)
ActionManager * action_manager;
//! filter that are stored in a manager
FilterManager * filter;
//! couplers handler
CouplerManager * coupler_manager;
//! geometry handler
GeometryManager * geometry_manager;
};
__END_LIBMULTISCALE__
#endif /* __LIBMULTISCALE_DOMAIN_MULTISCALE_HH__ */

Event Timeline