LifeV
|
MultiscaleCoupling - The Multiscale Physical Coupling. More...
#include <MultiscaleCoupling.hpp>
Type definitions | |
typedef MultiscaleCouplingFunction | couplingFunction_Type |
typedef std::shared_ptr< couplingFunction_Type > | couplingFunctionPtr_Type |
typedef std::vector< couplingFunction_Type > | couplingFunctionsContainer_Type |
typedef std::vector< multiscaleVectorPtr_Type > | couplingVariablesContainer_Type |
typedef std::vector< Real > | timeContainer_Type |
typedef multiscaleVector_Type::combineMode_Type | combineMode_Type |
Constructors & Destructor | |
MultiscaleCoupling () | |
Constructor. More... | |
virtual | ~MultiscaleCoupling () |
Destructor. More... | |
Multiscale PhysicalCoupling Virtual Methods | |
virtual void | setupData (const std::string &fileName) |
Setup the data of the coupling. More... | |
virtual void | setupCouplingVariablesNumber ()=0 |
Setup the coupling variables number. More... | |
virtual void | setupCoupling ()=0 |
Setup the coupling. More... | |
virtual void | initializeCouplingVariables ()=0 |
Initialize the values of the coupling variables. More... | |
virtual void | updateCoupling ()=0 |
Update the coupling. More... | |
virtual void | computeCouplingResiduals ()=0 |
Compute the values of the local coupling residuals. More... | |
virtual bool | topologyChange () |
Check if the topology is changed. More... | |
Methods | |
UInt | myModelsNumber () const |
Determine the number of models owned by this coupling. More... | |
bool | myModel (const UInt &localModelID) const |
Determine if the model is owned by this coupling. More... | |
bool | isModelLeaderProcess (const UInt &localModelID) const |
Determine if this is the model leader process. More... | |
void | createCouplingMap (MapEpetra &couplingMap) |
Build the global map for the coupling vectors. More... | |
void | importCouplingVariables (const multiscaleVector_Type &couplingVariables) |
Import the values of the coupling variables. More... | |
void | exportCouplingVariables (multiscaleVector_Type &couplingVariables) |
Export the values of the coupling variables. More... | |
void | exportCouplingResiduals (multiscaleVector_Type &couplingResiduals) |
Export the values of the coupling variables. More... | |
void | extrapolateCouplingVariables () |
Extrapolate the values of the coupling variables for the next time step. More... | |
void | interpolateCouplingVariables (const Real &t, multiscaleVector_Type &interpolatedCouplingVariables) const |
Lagrange interpolation/extrapolation of the coupling variables at selected time. More... | |
bool | isPerturbed () const |
Find if a perturbation is imposed on the coupling. More... | |
void | exportJacobian (multiscaleMatrix_Type &jacobian) |
Export the Jacobian matrix. More... | |
void | saveSolution () |
save the coupling variables information on a file More... | |
void | showMe () |
Display some information about the coupling. More... | |
void | showMeResiduals () const |
Display the local residuals vector. More... | |
void | showMeCouplingVariables () const |
Display the local coupling variables. More... | |
void | clearModelsList () |
Clear the list of pointers to the models. More... | |
Set Methods | |
void | setID (const UInt &ID) |
Set the global ID of the coupling condition. More... | |
void | setModelsNumber (const UInt &modelsNumber) |
Set the number of models coupled by this coupling condition. More... | |
void | setModel (const UInt &localModelID, const multiscaleModelPtr_Type &model) |
Add a pointer to one of the models to be coupled. More... | |
void | setBoundaryID (const UInt &modelLocalID, const multiscaleID_Type &boundaryLocalID) |
Set the boundary ID of one of the coupled models. More... | |
void | setGlobalData (const multiscaleDataPtr_Type &globalData) |
Setup the global data of the coupling. More... | |
void | setCommunicator (const multiscaleCommPtr_Type &comm) |
Set the epetra communicator for the coupling. More... | |
Get Methods | |
const UInt & | ID () const |
Get the global ID of the coupling. More... | |
const couplings_Type & | type () const |
Get the type of the coupling. More... | |
const std::string & | couplingName () const |
Get the name of the coupling. More... | |
UInt | modelsNumber () const |
Get the number of models connected by the coupling. More... | |
UInt | modelGlobalToLocalID (const UInt &ID) const |
Get the model local ID through global ID. More... | |
multiscaleModelPtr_Type | model (const UInt &localModelID) const |
Get the model connected by the coupling through local ID. More... | |
const multiscaleID_Type & | boundaryID (const UInt &localModelID) const |
Get the model connected by the coupling through local ID. More... | |
const UInt & | couplingVariablesNumber () const |
Get the number of the coupling variables. More... | |
const couplingVariablesContainer_Type & | couplingVariables () const |
Get the container of the local coupling variables. More... | |
const Int & | perturbedCoupling () const |
Get the perturbed coupling. More... | |
const multiscaleVector_Type & | residual () const |
Get the local residual. More... | |
const UInt & | timeInterpolationOrder () const |
Get the time interpolation order. More... | |
Protected MultiscaleCoupling Virtual Methods | |
virtual void | exportListOfPerturbedModels (const UInt &localCouplingVariableID, multiscaleModelsContainer_Type &perturbedModelsList)=0 |
Build the list of models affected by the perturbation of the local coupling variable. More... | |
virtual void | insertJacobianConstantCoefficients (multiscaleMatrix_Type &jacobian)=0 |
Insert constant coefficients into the Jacobian matrix. More... | |
virtual void | insertJacobianDeltaCoefficients (multiscaleMatrix_Type &jacobian, const UInt &column, const UInt &ID, bool &linearSystemSolved)=0 |
Insert the Jacobian coefficient(s) depending on a perturbation of the model, due to a specific variable (the column) More... | |
Protected Methods | |
const multiscaleVector_Type & | localCouplingVariables (const UInt &id) const |
Access by reference to a specific local coupling variable. More... | |
multiscaleVector_Type & | localCouplingVariables (const UInt &id) |
void | createLocalVectors () |
Create the local vectors of the coupling. More... | |
void | resetCouplingHistory () |
Reset the history of the couplings. More... | |
void | importCouplingVector (multiscaleVector_Type &repeatedLocalVector, const multiscaleVector_Type &uniqueGlobalVector, const combineMode_Type &combineMode=Add) |
Import the content of the unique global vector into the repeated local vector. More... | |
void | exportCouplingVector (multiscaleVector_Type &uniqueGlobalVector, const multiscaleVector_Type &repeatedLocalVector, const combineMode_Type &combineMode=Add) |
Export the content of the repeated local vector into the unique global vector. More... | |
void | switchErrorMessage (const multiscaleModelPtr_Type &model) |
Display and error message for the specific model. More... | |
Unimplemented Methods | |
MultiscaleCoupling (const MultiscaleCoupling &coupling) | |
MultiscaleCoupling & | operator= (const MultiscaleCoupling &coupling) |
MultiscaleCoupling - The Multiscale Physical Coupling.
The MultiscaleCoupling class provides a general interface between the MS_Algorithm and all the coupling conditions.
Definition at line 65 of file MultiscaleCoupling.hpp.
Definition at line 72 of file MultiscaleCoupling.hpp.
typedef std::shared_ptr< couplingFunction_Type > couplingFunctionPtr_Type |
Definition at line 73 of file MultiscaleCoupling.hpp.
typedef std::vector< couplingFunction_Type > couplingFunctionsContainer_Type |
Definition at line 74 of file MultiscaleCoupling.hpp.
typedef std::vector< multiscaleVectorPtr_Type > couplingVariablesContainer_Type |
Definition at line 76 of file MultiscaleCoupling.hpp.
typedef std::vector< Real > timeContainer_Type |
Definition at line 78 of file MultiscaleCoupling.hpp.
Definition at line 80 of file MultiscaleCoupling.hpp.
|
explicit |
Constructor.
Definition at line 49 of file MultiscaleCoupling.cpp.
|
inlinevirtual |
Destructor.
Definition at line 92 of file MultiscaleCoupling.hpp.
|
private |
|
virtual |
Setup the data of the coupling.
FileName | Name of data file |
Reimplemented in MultiscaleCouplingBoundaryCondition.
Definition at line 77 of file MultiscaleCoupling.cpp.
|
pure virtual |
Setup the coupling variables number.
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, MultiscaleCouplingMeanNormalStressArea, and MultiscaleCouplingMeanTotalNormalStressArea.
|
pure virtual |
|
pure virtual |
Initialize the values of the coupling variables.
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, MultiscaleCouplingMeanNormalStressArea, MultiscaleCouplingMeanTotalNormalStressArea, and MultiscaleCouplingMeanNormalStressValve.
|
pure virtual |
Update the coupling.
This method is the analogous of the "updateModel" for the models. It is alternative to initializeCouplingVariables and is called from the second timestep. It is reserved for the update of:
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, and MultiscaleCouplingMeanNormalStressValve.
|
pure virtual |
Compute the values of the local coupling residuals.
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, MultiscaleCouplingMeanNormalStressValve, MultiscaleCouplingMeanNormalStressArea, and MultiscaleCouplingMeanTotalNormalStressArea.
|
inlinevirtual |
Check if the topology is changed.
A topology change can be caused by a change in the coupling equations by, for example, the opening/closure of a valve (see MultiscaleCouplingFlowRateValve).
Reimplemented in MultiscaleCouplingMeanNormalStressValve.
Definition at line 136 of file MultiscaleCoupling.hpp.
|
inline |
Determine the number of models owned by this coupling.
Definition at line 558 of file MultiscaleCoupling.hpp.
|
inline |
Determine if the model is owned by this coupling.
Note: this method does not check if M_models is empty or not!
localModelID | local ID of the model. |
Definition at line 160 of file MultiscaleCoupling.hpp.
bool isModelLeaderProcess | ( | const UInt & | localModelID | ) | const |
Determine if this is the model leader process.
Note: this method does not check if the model is owned by the process! Use myModelsNumber() for that!
localModelID | local ID of the model. |
Definition at line 118 of file MultiscaleCoupling.cpp.
void createCouplingMap | ( | MapEpetra & | couplingMap | ) |
Build the global map for the coupling vectors.
couplingMap | Global coupling map |
Definition at line 124 of file MultiscaleCoupling.cpp.
|
inline |
Import the values of the coupling variables.
couplingVariables | Global vector of coupling variables |
Definition at line 185 of file MultiscaleCoupling.hpp.
|
inline |
Export the values of the coupling variables.
couplingVariables | Global vector of coupling variables |
Definition at line 194 of file MultiscaleCoupling.hpp.
|
inline |
Export the values of the coupling variables.
couplingVariables | Global vector of coupling variables |
Definition at line 203 of file MultiscaleCoupling.hpp.
void extrapolateCouplingVariables | ( | ) |
Extrapolate the values of the coupling variables for the next time step.
Definition at line 137 of file MultiscaleCoupling.cpp.
void interpolateCouplingVariables | ( | const Real & | t, |
multiscaleVector_Type & | interpolatedCouplingVariables | ||
) | const |
Lagrange interpolation/extrapolation of the coupling variables at selected time.
t | interpolation time |
interpolatedCouplingVariables | variables interpolated/extrapolated at time t |
Definition at line 176 of file MultiscaleCoupling.cpp.
|
inline |
Find if a perturbation is imposed on the coupling.
Definition at line 222 of file MultiscaleCoupling.hpp.
void exportJacobian | ( | multiscaleMatrix_Type & | jacobian | ) |
Export the Jacobian matrix.
Jacobian | Jacobian Matrix |
Definition at line 206 of file MultiscaleCoupling.cpp.
void saveSolution | ( | ) |
save the coupling variables information on a file
Definition at line 251 of file MultiscaleCoupling.cpp.
void showMe | ( | ) |
Display some information about the coupling.
Definition at line 299 of file MultiscaleCoupling.cpp.
void showMeResiduals | ( | ) | const |
Display the local residuals vector.
Definition at line 335 of file MultiscaleCoupling.cpp.
void showMeCouplingVariables | ( | ) | const |
Display the local coupling variables.
Definition at line 348 of file MultiscaleCoupling.cpp.
|
inline |
Clear the list of pointers to the models.
This method has to be called before the automatic destructor, in order to disconnect the coupling classes from the model classes.
Definition at line 250 of file MultiscaleCoupling.hpp.
|
inline |
Set the global ID of the coupling condition.
ID | Coupling global ID |
Definition at line 265 of file MultiscaleCoupling.hpp.
|
inline |
Set the number of models coupled by this coupling condition.
modelsNumber | number of models coupled by this coupling |
Definition at line 274 of file MultiscaleCoupling.hpp.
|
inline |
Add a pointer to one of the models to be coupled.
localModelID | local model ID |
model | shared_ptr of the model |
Definition at line 285 of file MultiscaleCoupling.hpp.
|
inline |
Set the boundary ID of one of the coupled models.
modelLocalID | model local ID |
boundaryID | boundary ID of the model |
Definition at line 295 of file MultiscaleCoupling.hpp.
|
inline |
Setup the global data of the coupling.
In particular, it can be used to replace the local values specified in the model data file, with the ones in the global container.
globalData | Global data container. |
Definition at line 307 of file MultiscaleCoupling.hpp.
|
inline |
Set the epetra communicator for the coupling.
comm | Epetra communicator |
Definition at line 316 of file MultiscaleCoupling.hpp.
Get the global ID of the coupling.
Definition at line 331 of file MultiscaleCoupling.hpp.
|
inline |
Get the type of the coupling.
Definition at line 340 of file MultiscaleCoupling.hpp.
|
inline |
Get the name of the coupling.
Definition at line 349 of file MultiscaleCoupling.hpp.
|
inline |
Get the number of models connected by the coupling.
Definition at line 358 of file MultiscaleCoupling.hpp.
Get the model local ID through global ID.
ID | global ID of the model |
Definition at line 364 of file MultiscaleCoupling.cpp.
|
inline |
Get the model connected by the coupling through local ID.
localModelID | local ID of the model |
Definition at line 375 of file MultiscaleCoupling.hpp.
|
inline |
Get the model connected by the coupling through local ID.
localModelID | local ID of the model |
Definition at line 385 of file MultiscaleCoupling.hpp.
|
inline |
Get the number of the coupling variables.
Definition at line 394 of file MultiscaleCoupling.hpp.
|
inline |
Get the container of the local coupling variables.
Definition at line 403 of file MultiscaleCoupling.hpp.
|
inline |
Get the perturbed coupling.
If it is unperturbed it returns -1.
Definition at line 413 of file MultiscaleCoupling.hpp.
|
inline |
Get the local residual.
Definition at line 422 of file MultiscaleCoupling.hpp.
|
inline |
Get the time interpolation order.
Definition at line 431 of file MultiscaleCoupling.hpp.
|
protectedpure virtual |
Build the list of models affected by the perturbation of the local coupling variable.
localCouplingVariableID | local coupling variable (perturbed) |
perturbedModelsList | list of models affected by the perturbation of the given coupling variable |
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, MultiscaleCouplingMeanNormalStressArea, and MultiscaleCouplingMeanTotalNormalStressArea.
|
protectedpure virtual |
Insert constant coefficients into the Jacobian matrix.
Jacobian | the Jacobian matrix |
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, MultiscaleCouplingMeanNormalStressArea, MultiscaleCouplingMeanTotalNormalStressArea, and MultiscaleCouplingMeanNormalStressValve.
|
protectedpure virtual |
Insert the Jacobian coefficient(s) depending on a perturbation of the model, due to a specific variable (the column)
Jacobian | the Jacobian matrix |
Column | the column related to the perturbed variable |
ID | the global ID of the model which is perturbed by the variable |
SolveLinearSystem | a flag to which determine if the linear system has to be solved |
Implemented in MultiscaleCouplingBoundaryCondition, MultiscaleCouplingMeanNormalStress, MultiscaleCouplingMeanTotalNormalStress, MultiscaleCouplingMeanNormalStressArea, MultiscaleCouplingMeanTotalNormalStressArea, and MultiscaleCouplingMeanNormalStressValve.
|
inlineprotected |
Access by reference to a specific local coupling variable.
This method is used to simplify the access to a specific local coupling variables vector. Note that the returned value is not const!
id | id of the local coupling variables vector |
Definition at line 479 of file MultiscaleCoupling.hpp.
|
inlineprotected |
|
protected |
Create the local vectors of the coupling.
Definition at line 382 of file MultiscaleCoupling.cpp.
|
protected |
Reset the history of the couplings.
This method is used when the topology change.
Definition at line 400 of file MultiscaleCoupling.cpp.
|
protected |
Import the content of the unique global vector into the repeated local vector.
repeatedLocalVector | the repeated local vector |
uniqueglobalVector | the unique global vector |
Definition at line 410 of file MultiscaleCoupling.cpp.
|
protected |
Export the content of the repeated local vector into the unique global vector.
uniqueGlobalVector | the unique global vector |
repeatedLocalVector | the repeated local vector |
Definition at line 419 of file MultiscaleCoupling.cpp.
|
protected |
Display and error message for the specific model.
model | shared_ptr to the specific model |
Definition at line 426 of file MultiscaleCoupling.cpp.
|
private |
|
protected |
Definition at line 519 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 520 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 522 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 523 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 524 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 526 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 528 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 529 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 531 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 532 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 533 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 535 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 536 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 538 of file MultiscaleCoupling.hpp.
|
protected |
Definition at line 540 of file MultiscaleCoupling.hpp.