LifeV
MultiscaleModel Class Referenceabstract

MultiscaleModel - The Multiscale Physical Model. More...

#include <MultiscaleModel.hpp>

+ Inheritance diagram for MultiscaleModel:
+ Collaboration diagram for MultiscaleModel:

Protected Member Functions

void displayModelStatus (const std::string &tag) const
 Display model ID and name with a user provided tag. More...
 

Protected Attributes

UInt M_ID
 
models_Type M_type
 
multiscaleCouplingsContainer_Type M_couplings
 
std::string M_modelName
 
multiscaleIDContainer_Type M_boundaryFlags
 
multiscaleDataPtr_Type M_globalData
 
std::array< Real, NDIMM_geometryScale
 
std::array< Real, NDIMM_geometryRotate
 
std::array< Real, NDIMM_geometryTranslate
 
multiscaleCommPtr_Type M_comm
 

Constructors & Destructor

 MultiscaleModel ()
 The main constructor. More...
 
virtual ~MultiscaleModel ()
 Destructor. More...
 

Multiscale PhysicalModel Virtual Methods

virtual void setupData (const std::string &fileName)
 Setup the data of the model. More...
 
virtual void setupModel ()=0
 Setup the model. More...
 
virtual void buildModel ()=0
 Build the initial model. More...
 
virtual void updateModel ()=0
 Update the model. More...
 
virtual void solveModel ()=0
 Solve the System. More...
 
virtual void updateSolution ()=0
 Update the solution. More...
 
virtual void saveSolution ()=0
 Save the solution. More...
 
virtual void showMe ()
 Display some information about the model. More...
 
virtual Real checkSolution () const =0
 Return a specific scalar quantity to be used for a comparison with a reference value. More...
 

Methods

void clearCouplingsList ()
 Clear the list of pointers to the couplings. More...
 

Set Methods

void setID (const UInt &id)
 Set the global ID of the model. More...
 
void setCouplingsNumber (const UInt &couplingsNumber)
 Set the number of couplings attached to this model. More...
 
void setCoupling (const UInt &localCouplingID, const multiscaleCouplingPtr_Type &coupling)
 Add a pointer to one of the couplings attached to this model. More...
 
void addCoupling (const multiscaleCouplingPtr_Type &coupling)
 Add a pointer to one of the couplings which couple the model. More...
 
void setGlobalData (const multiscaleDataPtr_Type &globalData)
 Setup the global data of the model. More...
 
void setGeometry (const std::array< Real, NDIM > &scale, const std::array< Real, NDIM > &rotate, const std::array< Real, NDIM > &translate)
 Scale, rotate and translate the Model in the 3D space. More...
 
void setCommunicator (const multiscaleCommPtr_Type &comm)
 Set the epetra communicator for the model. More...
 

Get Methods

const UIntID () const
 Get the global ID of the model. More...
 
const models_Typetype () const
 Get the type of the model. More...
 
const multiscaleID_TypeboundaryFlag (const multiscaleID_Type &boundaryID) const
 Get one available flag by id. More...
 
const std::string & modelName () const
 Get the name of the model. More...
 
UInt couplingsNumber () const
 Get the number of couplings connecting the model. More...
 
UInt couplingLocalID (const UInt &ID) const
 Get the coupling local ID through global ID. More...
 
multiscaleCouplingPtr_Type coupling (const UInt &localID) const
 Get the coupling through local ID. More...
 
const multiscaleDataPtr_TypeglobalData () const
 Get the global data of the model. More...
 
const multiscaleCommPtr_Typecommunicator () const
 Get the communicator of the model. More...
 

Unimplemented Methods

 MultiscaleModel (const MultiscaleModel &model)
 
MultiscaleModeloperator= (const MultiscaleModel &model)
 

Detailed Description

MultiscaleModel - The Multiscale Physical Model.

Author
Cristiano Malossi
See also
Full description of the Geometrical Multiscale Framework: [15]
Methodology: [12] [13] [14] [2]
Applications: [11] [10] [3]

The MultiscaleModel class provides a general interface between the MS_Algorithm and all the other models. Moreover it provides internal methods for accessing general information and model related couplings.

Definition at line 62 of file MultiscaleModel.hpp.

Constructor & Destructor Documentation

◆ MultiscaleModel() [1/2]

MultiscaleModel ( )
explicit

The main constructor.

All the derived classes has to be constructed using an empty constructor which calls (as first operation) this empty constructor.

Definition at line 49 of file MultiscaleModel.cpp.

+ Here is the caller graph for this function:

◆ ~MultiscaleModel()

virtual ~MultiscaleModel ( )
inlinevirtual

Destructor.

Definition at line 78 of file MultiscaleModel.hpp.

◆ MultiscaleModel() [2/2]

MultiscaleModel ( const MultiscaleModel model)
private

Member Function Documentation

◆ setupData()

void setupData ( const std::string &  fileName)
virtual

Setup the data of the model.

This method is called only once at the beginning of the simulation. It is designed for the following operations:

  1. read data from files;
  2. set global parameter for the MS simulation (viscosity, time, ...);
  3. perform preliminary operations which do not depend on the couplings.
Parameters
fileNameName of data file.

Reimplemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

Definition at line 79 of file MultiscaleModel.cpp.

◆ setupModel()

virtual void setupModel ( )
pure virtual

Setup the model.

In particular it does the following operations:

  1. initialize the model object;
  2. initialize all the other private objects;
  3. perform preliminary operations which depend on the couplings.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ buildModel()

virtual void buildModel ( )
pure virtual

Build the initial model.

This method is alternative to updateModel and should be called only once at the fist timestep. This method is reserved for the construction of:

  1. objects that are constant (with respect to the time);
  2. objects that are required for the first time step and should not be updated during subiterations.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ updateModel()

virtual void updateModel ( )
pure virtual

Update the model.

This method is alternative to buildModel and should be called from the second timestep. This method is reserved for the update of:

  1. objects that are not constant with respect to the time but should not be updated during subiterations.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ solveModel()

virtual void solveModel ( )
pure virtual

Solve the System.

This method is called once for each subiteration (in the case of implicit coupling). It computes the solution at time t_n+1.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ updateSolution()

virtual void updateSolution ( )
pure virtual

Update the solution.

This method is called after the last call to solveModel. It updates the solution both for the next time step and for the call to saveSolution.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ saveSolution()

virtual void saveSolution ( )
pure virtual

Save the solution.

This method wrote to file the solution computed during the last call of solveModel.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ showMe()

void showMe ( )
virtual

Display some information about the model.

Reimplemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

Definition at line 101 of file MultiscaleModel.cpp.

◆ checkSolution()

virtual Real checkSolution ( ) const
pure virtual

Return a specific scalar quantity to be used for a comparison with a reference value.

This method is meant to be used for night checks.

Returns
reference quantity.

Implemented in MultiscaleModelFSI3D, MultiscaleModelFSI1D, MultiscaleModelFluid3D, MultiscaleModel0D, MultiscaleModelMultiscale, and MultiscaleModelWindkessel0D.

◆ clearCouplingsList()

void clearCouplingsList ( )
inline

Clear the list of pointers to the couplings.

This method has to be called before the automatic destructor, in order to disconnect the coupling classes from the model classes.

Definition at line 173 of file MultiscaleModel.hpp.

◆ setID()

void setID ( const UInt id)
inline

Set the global ID of the model.

Parameters
idModel ID

Definition at line 188 of file MultiscaleModel.hpp.

◆ setCouplingsNumber()

void setCouplingsNumber ( const UInt couplingsNumber)
inline

Set the number of couplings attached to this model.

Parameters
couplingsNumbernumber of couplings attached to this model

Definition at line 197 of file MultiscaleModel.hpp.

◆ setCoupling()

void setCoupling ( const UInt localCouplingID,
const multiscaleCouplingPtr_Type coupling 
)
inline

Add a pointer to one of the couplings attached to this model.

Parameters
localCouplingIDlocal coupling ID
couplingshared_ptr of the coupling

Definition at line 207 of file MultiscaleModel.hpp.

◆ addCoupling()

void addCoupling ( const multiscaleCouplingPtr_Type coupling)
inline

Add a pointer to one of the couplings which couple the model.

Parameters
couplingshared_ptr of the coupling

Definition at line 216 of file MultiscaleModel.hpp.

◆ setGlobalData()

void setGlobalData ( const multiscaleDataPtr_Type globalData)
inline

Setup the global data of the model.

In particular, it can be used to replace the local values specified in the model data file, with the ones in the global container.

Parameters
globalDataGlobal data container.

Definition at line 228 of file MultiscaleModel.hpp.

◆ setGeometry()

void setGeometry ( const std::array< Real, NDIM > &  scale,
const std::array< Real, NDIM > &  rotate,
const std::array< Real, NDIM > &  translate 
)

Scale, rotate and translate the Model in the 3D space.

This method apply directly to the mesh before its partitioning.

Parameters
scaleVector (Sx,Sy,Sz) of scale factors
rotateVector (Rx,Ry,Rz) of angles for rotation (degree units)
translateVector (Tx,Ty,Tz) of offset for position

Definition at line 151 of file MultiscaleModel.cpp.

◆ setCommunicator()

void setCommunicator ( const multiscaleCommPtr_Type comm)
inline

Set the epetra communicator for the model.

Parameters
commEpetra communicator

Definition at line 248 of file MultiscaleModel.hpp.

◆ ID()

const UInt& ID ( ) const
inline

Get the global ID of the model.

Returns
global ID of the model

Definition at line 263 of file MultiscaleModel.hpp.

◆ type()

const models_Type& type ( ) const
inline

Get the type of the model.

Returns
type of the model

Definition at line 272 of file MultiscaleModel.hpp.

◆ boundaryFlag()

const multiscaleID_Type& boundaryFlag ( const multiscaleID_Type boundaryID) const
inline

Get one available flag by id.

Parameters
idid of the boundary flag
Returns
flag

Definition at line 282 of file MultiscaleModel.hpp.

◆ modelName()

const std::string& modelName ( ) const
inline

Get the name of the model.

Returns
name of the model

Definition at line 291 of file MultiscaleModel.hpp.

◆ couplingsNumber()

UInt couplingsNumber ( ) const
inline

Get the number of couplings connecting the model.

Returns
number of couplings connecting the model

Definition at line 300 of file MultiscaleModel.hpp.

+ Here is the caller graph for this function:

◆ couplingLocalID()

UInt couplingLocalID ( const UInt ID) const

Get the coupling local ID through global ID.

Parameters
IDglobal ID of the coupling
Returns
local ID of the coupling

Definition at line 169 of file MultiscaleModel.cpp.

◆ coupling()

multiscaleCouplingPtr_Type coupling ( const UInt localID) const
inline

Get the coupling through local ID.

Parameters
IDlocal ID of the coupling
Returns
Pointer to the coupling

Definition at line 317 of file MultiscaleModel.hpp.

◆ globalData()

const multiscaleDataPtr_Type& globalData ( ) const
inline

Get the global data of the model.

Returns
Global data container.

Definition at line 326 of file MultiscaleModel.hpp.

◆ communicator()

const multiscaleCommPtr_Type& communicator ( ) const
inline

Get the communicator of the model.

Returns
Communicator of the model.

Definition at line 335 of file MultiscaleModel.hpp.

◆ displayModelStatus()

void displayModelStatus ( const std::string &  tag) const
inlineprotected

Display model ID and name with a user provided tag.

Parameters
taguser provided tag.

Definition at line 381 of file MultiscaleModel.hpp.

◆ operator=()

MultiscaleModel& operator= ( const MultiscaleModel model)
private

Field Documentation

◆ M_ID

UInt M_ID
protected

Definition at line 350 of file MultiscaleModel.hpp.

◆ M_type

models_Type M_type
protected

Definition at line 351 of file MultiscaleModel.hpp.

◆ M_couplings

multiscaleCouplingsContainer_Type M_couplings
protected

Definition at line 353 of file MultiscaleModel.hpp.

◆ M_modelName

std::string M_modelName
protected

Definition at line 354 of file MultiscaleModel.hpp.

◆ M_boundaryFlags

multiscaleIDContainer_Type M_boundaryFlags
protected

Definition at line 355 of file MultiscaleModel.hpp.

◆ M_globalData

multiscaleDataPtr_Type M_globalData
protected

Definition at line 357 of file MultiscaleModel.hpp.

◆ M_geometryScale

std::array< Real, NDIM > M_geometryScale
protected

Definition at line 359 of file MultiscaleModel.hpp.

◆ M_geometryRotate

std::array< Real, NDIM > M_geometryRotate
protected

Definition at line 360 of file MultiscaleModel.hpp.

◆ M_geometryTranslate

std::array< Real, NDIM > M_geometryTranslate
protected

Definition at line 361 of file MultiscaleModel.hpp.

◆ M_comm

multiscaleCommPtr_Type M_comm
protected

Definition at line 363 of file MultiscaleModel.hpp.


The documentation for this class was generated from the following files: