LifeV
|
BCInterface - LifeV interface to load boundary conditions completely from a GetPot
file.
More...
#include <BCInterface.hpp>
Protected Attributes | |
bcHandlerPtr_Type | M_handler |
vectorFunction_Type | M_vectorFunction |
vectorFunctionSolverDefined_Type | M_vectorFunctionSolverDefined |
Type definitions | |
typedef BcHandler | bcHandler_Type |
typedef std::shared_ptr< bcHandler_Type > | bcHandlerPtr_Type |
typedef PhysicalSolverType | physicalSolver_Type |
typedef std::shared_ptr< physicalSolver_Type > | physicalSolverPtr_Type |
typedef BCInterfaceFactory< bcHandler_Type, physicalSolver_Type > | factory_Type |
typedef factory_Type::bcFunctionPtr_Type | bcFunctionPtr_Type |
typedef std::vector< bcFunctionPtr_Type > | vectorFunction_Type |
typedef factory_Type::bcFunctionParserSolver_Type | bcFunctionParserSolver_Type |
typedef factory_Type::bcFunctionParserSolverPtr_Type | bcFunctionParserSolverPtr_Type |
typedef factory_Type::bcFunctionSolverDefinedPtr_Type | bcFunctionSolverDefinedPtr_Type |
typedef std::vector< bcFunctionSolverDefinedPtr_Type > | vectorFunctionSolverDefined_Type |
typedef BCInterfaceData | data_Type |
typedef std::shared_ptr< data_Type > | dataPtr_Type |
Constructors & Destructor | |
BCInterface () | |
Constructor. More... | |
virtual | ~BCInterface () |
Destructor. More... | |
Methods | |
void | createHandler () |
Create the bcHandler. More... | |
void | fillHandler (const std::string &fileName, const std::string &dataSection) |
Fill the bcHandler with the BC provided in the file. More... | |
virtual void | readBC (const std::string &fileName, const std::string &dataSection, const std::string &name)=0 |
Read a specific boundary condition from a file and add it to the data container. More... | |
virtual void | insertBC ()=0 |
Insert the current boundary condition in the BChandler. More... | |
virtual void | updatePhysicalSolverVariables () |
Update the variables inside the physical solver. More... | |
Set Methods | |
virtual void | setPhysicalSolver (const physicalSolverPtr_Type &physicalSolver) |
Set a physical solver. More... | |
void | setHandler (const bcHandlerPtr_Type &handler) |
Set an Handler. More... | |
Get Methods | |
bcHandlerPtr_Type & | handler () |
Get the shared_ptr to the BCHandler. More... | |
virtual data_Type & | dataContainer ()=0 |
Get the data container. More... | |
Unimplemented Methods | |
BCInterface (const BCInterface &interface1D) | |
BCInterface & | operator= (const BCInterface &interface1D) |
BCInterface - LifeV interface to load boundary conditions completely from a GetPot
file.
This class allows to impose boundary conditions completely from a GetPot
file. You can derive a specific implementation for the BCHandler of your problem. For 0D (BCInterface0D
), 1D (BCInterface1D
) and 3D (BCInterface3D
) problems the derived classes are already available.
EXAMPLE - DATA FILE
In the GetPot data file, BCInterface
reads a new section: [boundary_conditions]
.
Inside the new section there is a list of boundary conditions which correspond to other sub-section with the same name, for example: list = 'InFlow OutFlow'
Each boundary condition has a similar structure. The list of properties depends from the type of the boundary condition (if it is for 1D or 3D solver for example). For example:
[InFlow]
...
...
function = '3*0.03*(1/4-(x^2+y^2)'
[OutFlow]
...
...
function = '0'
The string function
represents the base module and can be replaced by other derived/alternative modules. The following functions are available (see the related classes for more information):
function
, which is implemented in BCInterfaceFunctionParser
; functionFile
, which is implemented in BCInterfaceFunctionParserFile
; functionSolver
, which is implemented in BCInterfaceFunctionParserSolver
; functionFileSolver
, which is implemented in BCInterfaceFunctionParserFileSolver
; All the parameters are case sensitive.
EXAMPLE - HOW TO USE
Here there is a short guide on how to create and use a BCInterface object.
First of all, you have to define a BCInterface class:
BCInterface bcInterface;
You can create an empty handler by calling:
bcInterface.createHandler()
or you can set it from outside
std::shared_ptr< bcHandler_Type > bcHandler( new bcHandler_Type() );
bcInterface.setHandler( bcHandler );
Then you can add all the file boundary condition by calling
bcInterface.fillHandler( "fileName.dat", "section" );
Or you can add one specific boundary conditions by calling
bcInterface.readBC( "fileName.dat", "section", "bcSection" );
bcInterface.insertBC();
Note that between readBC and insertBC you can manipulate the BC parameters by accessing the data container:
bcInterface.dataContainer();
In addition, you can also add BC directly from the code by accessing the bcHandler
M_bc.handler()->addBC( ... );
If you are using functions that use solver variables first you have to pass the solver
M_bc.setPhysicalSolver( physicalSolverPtr );
Then be sure to update the variable at each time step before using the BCHandler:
M_bc.updatePhysicalSolverVariables();
Finally, to get the handler you can use:
M_bc.handler();
Definition at line 158 of file BCInterface.hpp.
typedef BcHandler bcHandler_Type |
Definition at line 165 of file BCInterface.hpp.
typedef std::shared_ptr< bcHandler_Type > bcHandlerPtr_Type |
Definition at line 166 of file BCInterface.hpp.
typedef PhysicalSolverType physicalSolver_Type |
Definition at line 168 of file BCInterface.hpp.
typedef std::shared_ptr< physicalSolver_Type > physicalSolverPtr_Type |
Definition at line 169 of file BCInterface.hpp.
Definition at line 171 of file BCInterface.hpp.
Definition at line 173 of file BCInterface.hpp.
typedef std::vector< bcFunctionPtr_Type > vectorFunction_Type |
Definition at line 174 of file BCInterface.hpp.
Definition at line 176 of file BCInterface.hpp.
Definition at line 177 of file BCInterface.hpp.
Definition at line 179 of file BCInterface.hpp.
typedef std::vector< bcFunctionSolverDefinedPtr_Type > vectorFunctionSolverDefined_Type |
Definition at line 180 of file BCInterface.hpp.
typedef BCInterfaceData data_Type |
Definition at line 182 of file BCInterface.hpp.
typedef std::shared_ptr< data_Type > dataPtr_Type |
Definition at line 183 of file BCInterface.hpp.
|
explicit |
Constructor.
Definition at line 302 of file BCInterface.hpp.
|
inlinevirtual |
Destructor.
Definition at line 195 of file BCInterface.hpp.
|
private |
|
inline |
Create the bcHandler.
Definition at line 204 of file BCInterface.hpp.
void fillHandler | ( | const std::string & | fileName, |
const std::string & | dataSection | ||
) |
Fill the bcHandler with the BC provided in the file.
fileName | Name of the data file |
dataSection | Subsection inside [boundary_conditions] |
Definition at line 319 of file BCInterface.hpp.
|
pure virtual |
Read a specific boundary condition from a file and add it to the data container.
fileName | Name of the data file |
dataSection | section in the data file |
name | name of the boundary condition |
Implemented in BCInterface3D< BcHandler, PhysicalSolverType >, BCInterface1D< BcHandler, PhysicalSolverType >, and BCInterface0D< BcHandler, PhysicalSolverType >.
|
pure virtual |
Insert the current boundary condition in the BChandler.
Implemented in BCInterface3D< BcHandler, PhysicalSolverType >, BCInterface1D< BcHandler, PhysicalSolverType >, and BCInterface0D< BcHandler, PhysicalSolverType >.
|
virtual |
Update the variables inside the physical solver.
Definition at line 338 of file BCInterface.hpp.
|
virtual |
Set a physical solver.
physicalSolver | physical solver |
Reimplemented in BCInterface3D< BcHandler, PhysicalSolverType >.
Definition at line 366 of file BCInterface.hpp.
|
inline |
|
inline |
Get the shared_ptr to the BCHandler.
Definition at line 261 of file BCInterface.hpp.
|
pure virtual |
Get the data container.
Implemented in BCInterface3D< BcHandler, PhysicalSolverType >, BCInterface1D< BcHandler, PhysicalSolverType >, and BCInterface0D< BcHandler, PhysicalSolverType >.
|
private |
|
protected |
Definition at line 278 of file BCInterface.hpp.
|
protected |
Definition at line 281 of file BCInterface.hpp.
|
protected |
Definition at line 284 of file BCInterface.hpp.