LifeV
BCFunctionBase Class Reference

BCFunctionBase - class that holds the function used for prescribing boundary conditions. More...

#include <BCFunction.hpp>

+ Inheritance diagram for BCFunctionBase:
+ Collaboration diagram for BCFunctionBase:

Protected Attributes

function_Type M_userDefinedFunction
 user defined function More...
 

Public Types

typedef std::function< Real(const Real &, const Real &, const Real &, const Real &, const ID &) > function_Type
 
typedef std::shared_ptr< BCFunctionBaseBCFunctionBasePtr_Type
 

Constructors & Destructor

 BCFunctionBase ()
 Empty Constructor. More...
 
 BCFunctionBase (function_Type userDefinedFunction)
 Constructor for a user defined function. More...
 
 BCFunctionBase (const BCFunctionBase &bcFunctionBase)
 Copy Constructor. More...
 
virtual ~BCFunctionBase ()
 Destructor. More...
 

Operators

virtual BCFunctionBaseoperator= (const BCFunctionBase &bcFunctionBase)
 Assignment Operator. More...
 
Real operator() (const Real &t, const Real &x, const Real &y, const Real &z, const ID &component) const
 Overloading function operator by calling M_userDefinedFunction. More...
 

Set Methods

void setFunction (function_Type userDefinedFunction)
 Set the user defined function. More...
 

Get Methods

const function_TypeFunction () const
 Get the function. More...
 

Methods

virtual BCFunctionBasePtr_Type clone () const
 Clone the current object. More...
 

Detailed Description

BCFunctionBase - class that holds the function used for prescribing boundary conditions.

Author
Miguel Fernandez

This class holds the function used for prescribing Essential or Natural boundary conditions. The data functions given by the user must have the following signature.

Real f(const Real& time, const Real& x, const Real& y, const Real& z, const ID& component).

In the case of Essential boundary condition, we want to prescribe

u =  f

on part of the boundary, where u is the solution and f the user defined function. In the case of Natural boundary condition, we want to add the to the right hand side of the equation the following term:

( f, phi )_bd

Here ( . , . )_bd denote the L^2 inner product on the boundary, phi is the test function

Functions f and is set using the correct constructor or using setFunction(f).
To get the function f use getFunction(), to evaluate it use the operator().

This is the base class for other BCFunctionXXX classes. Inheritance is used to hold specific boundary condition data.

Definition at line 77 of file BCFunction.hpp.

Member Typedef Documentation

◆ function_Type

typedef std::function<Real ( const Real&, const Real&, const Real&, const Real&, const ID& ) > function_Type

Definition at line 84 of file BCFunction.hpp.

◆ BCFunctionBasePtr_Type

typedef std::shared_ptr<BCFunctionBase> BCFunctionBasePtr_Type

Definition at line 85 of file BCFunction.hpp.

Constructor & Destructor Documentation

◆ BCFunctionBase() [1/3]

BCFunctionBase ( )
inline

Empty Constructor.

The user must supply a function by calling setFunction(..)

Definition at line 96 of file BCFunction.hpp.

◆ BCFunctionBase() [2/3]

BCFunctionBase ( function_Type  userDefinedFunction)

Constructor for a user defined function.

Parameters
userDefinedFunctionthe user defined function

Definition at line 56 of file BCFunction.cpp.

+ Here is the caller graph for this function:

◆ BCFunctionBase() [3/3]

BCFunctionBase ( const BCFunctionBase bcFunctionBase)

Copy Constructor.

Parameters
bcFunctionBaseThe BCFunctionBase

Definition at line 62 of file BCFunction.cpp.

+ Here is the caller graph for this function:

◆ ~BCFunctionBase()

virtual ~BCFunctionBase ( )
inlinevirtual

Destructor.

Definition at line 112 of file BCFunction.hpp.

Member Function Documentation

◆ operator=()

BCFunctionBase & operator= ( const BCFunctionBase bcFunctionBase)
virtual

Assignment Operator.

Parameters
bcFunctionBaseThe BCFunctionBase
Returns
Reference to a new BCFunctionBase object with the same content of bcFunctionBase

Definition at line 75 of file BCFunction.cpp.

+ Here is the caller graph for this function:

◆ operator()()

Real operator() ( const Real t,
const Real x,
const Real y,
const Real z,
const ID component 
) const
inline

Overloading function operator by calling M_userDefinedFunction.

Parameters
tTime
xCoordinate x
yCoordinate y
zCoordinate z
componentThe Component of the vector function
Returns
The selected component of the user defined function evaluated in (t,x,y,z)

Definition at line 136 of file BCFunction.hpp.

◆ setFunction()

void setFunction ( function_Type  userDefinedFunction)
inline

Set the user defined function.

Parameters
userDefinedFunctionthe user defined function

Definition at line 152 of file BCFunction.hpp.

+ Here is the caller graph for this function:

◆ Function()

const function_Type& Function ( ) const
inline

Get the function.

Returns
Reference to M_userDefinedFunction

Definition at line 166 of file BCFunction.hpp.

◆ clone()

virtual BCFunctionBasePtr_Type clone ( ) const
inlinevirtual

Clone the current object.

Returns
Pointer to the cloned object

Reimplemented in BCFunctionRobin.

Definition at line 180 of file BCFunction.hpp.

Field Documentation

◆ M_userDefinedFunction

function_Type M_userDefinedFunction
protected

user defined function

Definition at line 192 of file BCFunction.hpp.


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