LifeV
MultiscaleAlgorithm Class Referenceabstract

MultiscaleAlgorithm - The Multiscale Algorithm Interface. More...

#include <MultiscaleAlgorithm.hpp>

+ Inheritance diagram for MultiscaleAlgorithm:
+ Collaboration diagram for MultiscaleAlgorithm:

Protected Attributes

algorithms_Type M_type
 
std::string M_name
 
multiscaleModelMultiscalePtr_Type M_multiscale
 
multiscaleVectorPtr_Type M_couplingVariables
 
multiscaleVectorPtr_Type M_couplingResiduals
 
multiscaleCommPtr_Type M_comm
 
UInt M_subiterationsMaximumNumber
 
Real M_tolerance
 

Type definitions

typedef MultiscaleModelMultiscale multiscaleModelMultiscale_Type
 
typedef multiscaleModelMultiscale_TypemultiscaleModelMultiscalePtr_Type
 

Constructors & Destructor

 MultiscaleAlgorithm ()
 Constructor. More...
 
virtual ~MultiscaleAlgorithm ()
 Destructor. More...
 

Multiscale Algorithm Virtual Methods

virtual void setupData (const std::string &fileName)=0
 Setup the data of the algorithm using a data file. More...
 
virtual void setupAlgorithm ()
 Setup coupling variables and other quantities of the algorithm. More...
 
virtual void subIterate ()
 Perform sub-iteration on the coupling variables. More...
 
virtual void showMe ()
 Display some information about the algorithm. More...
 

Methods

Real computeResidual () const
 

Set Methods

void setCommunicator (const multiscaleCommPtr_Type &comm)
 Set the epetra communicator for the model. More...
 
void setMultiscaleModel (const multiscaleModelMultiscalePtr_Type model)
 Set the main Multiscale model. More...
 
void setSubiterationsMaximumNumber (const UInt &subiterationsMaximumNumber)
 Set the maximum number of subiterations. More...
 
void setTolerance (const Real &tolerance)
 Set the tolerance. More...
 
void setAlgorithmName (const multiscaleParameterList_Type &parameterList)
 Set the algorithm name. More...
 
virtual void setAlgorithmParameters (const multiscaleParameterList_Type &parameterList)
 Set the the main parameters of the algorithm (tolerance, maximum number of subiterations, etc.) More...
 

Get Methods

const algorithms_Typetype () const
 Get the type of the algorithm. More...
 
const multiscaleModelMultiscalePtr_TypemultiScaleProblem () const
 Get the Multiscale problem. More...
 
const multiscaleVectorPtr_TypecouplingVariables () const
 Get the coupling variables. More...
 
const multiscaleVectorPtr_TypecouplingResiduals () const
 Get the coupling residuals. More...
 
const multiscaleCommPtr_Typecommunicator () const
 Get the communicator. More...
 
const UIntsubiterationsMaximumNumber () const
 Get the subiterations maximum number. More...
 
const Realtolerance () const
 Get the required tolerance. More...
 

Protected Methods

void save (const UInt &subiterationsNumber, const Real &residual) const
 save on a Matlab file the information about the convergence of the algorithm. More...
 
bool checkResidual (const UInt &subIT=0) const
 Update the residual and check if the tolerance has been satisfied. More...
 

Unimplemented Methods

 MultiscaleAlgorithm (const MultiscaleAlgorithm &algorithm)
 
MultiscaleAlgorithmoperator= (const MultiscaleAlgorithm &algorithm)
 

Detailed Description

MultiscaleAlgorithm - The Multiscale Algorithm Interface.

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

The MultiscaleAlgorithm class provides a general interface between the MultiscaleSolver and the specific Algorithm to solve the problem.

Definition at line 67 of file MultiscaleAlgorithm.hpp.

Member Typedef Documentation

◆ multiscaleModelMultiscale_Type

◆ multiscaleModelMultiscalePtr_Type

Constructor & Destructor Documentation

◆ MultiscaleAlgorithm() [1/2]

MultiscaleAlgorithm ( )
explicit

Constructor.

Definition at line 49 of file MultiscaleAlgorithm.cpp.

+ Here is the caller graph for this function:

◆ ~MultiscaleAlgorithm()

virtual ~MultiscaleAlgorithm ( )
inlinevirtual

Destructor.

Definition at line 87 of file MultiscaleAlgorithm.hpp.

◆ MultiscaleAlgorithm() [2/2]

MultiscaleAlgorithm ( const MultiscaleAlgorithm algorithm)
private

Member Function Documentation

◆ setupData()

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

Setup the data of the algorithm using a data file.

Parameters
fileNameName of the data file.

Implemented in MultiscaleAlgorithmBroyden, MultiscaleAlgorithmAitken, MultiscaleAlgorithmNewton, and MultiscaleAlgorithmExplicit.

◆ setupAlgorithm()

void setupAlgorithm ( )
virtual

Setup coupling variables and other quantities of the algorithm.

Reimplemented in MultiscaleAlgorithmBroyden.

Definition at line 70 of file MultiscaleAlgorithm.cpp.

◆ subIterate()

void subIterate ( )
virtual

Perform sub-iteration on the coupling variables.

Reimplemented in MultiscaleAlgorithmBroyden, MultiscaleAlgorithmAitken, MultiscaleAlgorithmNewton, and MultiscaleAlgorithmExplicit.

Definition at line 87 of file MultiscaleAlgorithm.cpp.

◆ showMe()

void showMe ( )
virtual

Display some information about the algorithm.

Reimplemented in MultiscaleAlgorithmBroyden, and MultiscaleAlgorithmAitken.

Definition at line 102 of file MultiscaleAlgorithm.cpp.

◆ computeResidual()

Real computeResidual ( ) const

Definition at line 117 of file MultiscaleAlgorithm.cpp.

+ Here is the caller graph for this function:

◆ setCommunicator()

void setCommunicator ( const multiscaleCommPtr_Type comm)
inline

Set the epetra communicator for the model.

Parameters
commEpetra communicator

Definition at line 128 of file MultiscaleAlgorithm.hpp.

◆ setMultiscaleModel()

void setMultiscaleModel ( const multiscaleModelMultiscalePtr_Type  model)
inline

Set the main Multiscale model.

Parameters
modelMultiscale model

Definition at line 137 of file MultiscaleAlgorithm.hpp.

◆ setSubiterationsMaximumNumber()

void setSubiterationsMaximumNumber ( const UInt subiterationsMaximumNumber)
inline

Set the maximum number of subiterations.

Parameters
subiterationsMaximumNumbermaximum number of subiterations

Definition at line 146 of file MultiscaleAlgorithm.hpp.

◆ setTolerance()

void setTolerance ( const Real tolerance)
inline

Set the tolerance.

Parameters
tolerancecoupling tolerance

Definition at line 155 of file MultiscaleAlgorithm.hpp.

◆ setAlgorithmName()

void setAlgorithmName ( const multiscaleParameterList_Type parameterList)

Set the algorithm name.

Parameters
parameterListteuchos list of parameters

Definition at line 133 of file MultiscaleAlgorithm.cpp.

◆ setAlgorithmParameters()

void setAlgorithmParameters ( const multiscaleParameterList_Type parameterList)
virtual

Set the the main parameters of the algorithm (tolerance, maximum number of subiterations, etc.)

Parameters
parameterListteuchos list of parameters

Reimplemented in MultiscaleAlgorithmBroyden, and MultiscaleAlgorithmAitken.

Definition at line 139 of file MultiscaleAlgorithm.cpp.

◆ type()

const algorithms_Type& type ( ) const
inline

Get the type of the algorithm.

Returns
type of the algorithm

Definition at line 182 of file MultiscaleAlgorithm.hpp.

◆ multiScaleProblem()

const multiscaleModelMultiscalePtr_Type& multiScaleProblem ( ) const
inline

Get the Multiscale problem.

Returns
shared_ptr to the Multiscale problem

Definition at line 191 of file MultiscaleAlgorithm.hpp.

◆ couplingVariables()

const multiscaleVectorPtr_Type& couplingVariables ( ) const
inline

Get the coupling variables.

Returns
pointer to the coupling variables vector

Definition at line 200 of file MultiscaleAlgorithm.hpp.

◆ couplingResiduals()

const multiscaleVectorPtr_Type& couplingResiduals ( ) const
inline

Get the coupling residuals.

Returns
pointer to the coupling residuals vector

Definition at line 209 of file MultiscaleAlgorithm.hpp.

◆ communicator()

const multiscaleCommPtr_Type& communicator ( ) const
inline

Get the communicator.

Returns
pointer to the communicator

Definition at line 218 of file MultiscaleAlgorithm.hpp.

◆ subiterationsMaximumNumber()

const UInt& subiterationsMaximumNumber ( ) const
inline

Get the subiterations maximum number.

Returns
maximum number of subiterations

Definition at line 227 of file MultiscaleAlgorithm.hpp.

◆ tolerance()

const Real& tolerance ( ) const
inline

Get the required tolerance.

Returns
tolerance

Definition at line 236 of file MultiscaleAlgorithm.hpp.

◆ save()

void save ( const UInt subiterationsNumber,
const Real residual 
) const
protected

save on a Matlab file the information about the convergence of the algorithm.

Parameters
subiterationsNumberNumber of subiterations performed.
computeResidualcomputeResidual.

Definition at line 149 of file MultiscaleAlgorithm.cpp.

◆ checkResidual()

bool checkResidual ( const UInt subIT = 0) const
protected

Update the residual and check if the tolerance has been satisfied.

Parameters
subITsubiteration number (for output purpose)
Returns
true if the tolerance is satisfied

Definition at line 179 of file MultiscaleAlgorithm.cpp.

◆ operator=()

MultiscaleAlgorithm& operator= ( const MultiscaleAlgorithm algorithm)
private

Field Documentation

◆ M_type

algorithms_Type M_type
protected

Definition at line 264 of file MultiscaleAlgorithm.hpp.

◆ M_name

std::string M_name
protected

Definition at line 265 of file MultiscaleAlgorithm.hpp.

◆ M_multiscale

multiscaleModelMultiscalePtr_Type M_multiscale
protected

Definition at line 267 of file MultiscaleAlgorithm.hpp.

◆ M_couplingVariables

multiscaleVectorPtr_Type M_couplingVariables
protected

Definition at line 269 of file MultiscaleAlgorithm.hpp.

◆ M_couplingResiduals

multiscaleVectorPtr_Type M_couplingResiduals
protected

Definition at line 270 of file MultiscaleAlgorithm.hpp.

◆ M_comm

multiscaleCommPtr_Type M_comm
protected

Definition at line 272 of file MultiscaleAlgorithm.hpp.

◆ M_subiterationsMaximumNumber

UInt M_subiterationsMaximumNumber
protected

Definition at line 274 of file MultiscaleAlgorithm.hpp.

◆ M_tolerance

Real M_tolerance
protected

Definition at line 275 of file MultiscaleAlgorithm.hpp.


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