#include <boundary_functions_lib.h>
Public Member Functions | |
FCubeBoundaryCondition (double xdim, double ydim, double zdim, double left, double right, double front, double back, double bottom, double top) | |
~FCubeBoundaryCondition () | |
virtual double | operator() (const VecDouble &p, const unsigned int component=0) const |
virtual bool | isInDomain (const VecDouble &p, unsigned component=0) const |
Private Attributes | |
double | m_left |
double | m_right |
double | m_top |
double | m_bottom |
double | m_front |
double | m_back |
double | m_XDim |
double | m_YDim |
double | m_ZDim |
double | _tol |
This function defines boundary conditions for cube ortoghonal meshes such that the boundary conditions are prescribed as constants for each cube side. If a value passed in the constructor of the class corresponding to a side is prescribed as INFINITE, then is assumed that there is no boundary condition for such side.
Boundaries conditions of these type are perfect for simulate unidimensional and 2D problems being very useful for debug purposes.
Definition at line 17 of file boundary_functions_lib.h.
FCubeBoundaryCondition::FCubeBoundaryCondition | ( | double | xdim, | |
double | ydim, | |||
double | zdim, | |||
double | left, | |||
double | right, | |||
double | front, | |||
double | back, | |||
double | bottom, | |||
double | top | |||
) |
xdim | Size in X dimension | |
ydim | Size in Y dimension | |
zdim | Size in Z " " | |
left | Value for the left boundary (X == 0) | |
right | Value for the right boundary (X == Xdim) | |
front | Value for the front boundary (Y == 0) | |
back | Value for the back boundary (Y == Ydim) | |
bottom | Value for the bottom boundary (Z == 0) | |
top | Value for the the top boundary (Z == Zdim) |
Definition at line 16 of file boundary_functions_lib.cpp.
FCubeBoundaryCondition::~FCubeBoundaryCondition | ( | ) | [inline] |
Definition at line 25 of file boundary_functions_lib.h.
virtual bool FCubeBoundaryCondition::isInDomain | ( | const VecDouble & | p, | |
unsigned | component = 0 | |||
) | const [virtual] |
Reimplemented from GeneralFunctionInterface.
double FCubeBoundaryCondition::operator() | ( | const VecDouble & | p, | |
const unsigned int | component = 0 | |||
) | const [virtual] |
Return the value of the function in a point p. If the poins is not at the boundary the function returns NAN since the function is not defined inside the domain.
p | ||
component | Compoenent of the function. |
Implements GeneralFunctionInterface.
Definition at line 39 of file boundary_functions_lib.cpp.
00040 { 00041 assert(component == 0); 00042 if (NumericMethods::a_equal(p(0),0 ,_tol) && m_left != INFINITY) 00043 { 00044 return m_left; 00045 } 00046 if (NumericMethods::a_equal(p(0),m_XDim,_tol) && m_right != INFINITY) 00047 { 00048 return m_right; 00049 } 00050 if (NumericMethods::a_equal(p(1),m_YDim,_tol) && m_back != INFINITY) 00051 { 00052 return m_back; 00053 } 00054 if (NumericMethods::a_equal(p(1),0 ,_tol) && m_front != INFINITY) 00055 { 00056 return m_front; 00057 } 00058 if (NumericMethods::a_equal(p(2),m_ZDim,_tol) && m_top != INFINITY) 00059 { 00060 return m_top; 00061 } 00062 if (NumericMethods::a_equal(p(2),0,_tol) && m_bottom != INFINITY) 00063 { 00064 return m_bottom; 00065 } 00066 assert(0); //The point p doesnt belong to the boundary this might be a error. 00067 //So lets abort in the debug version. 00068 throw new Exception("FCubeBoundary::value() The point <%g,%g,%g> passed doesnt belong to the boundary",p(0),p(1),p(2)); 00069 return NAN; 00070 }
double FCubeBoundaryCondition::_tol [private] |
Definition at line 22 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_back [private] |
Definition at line 20 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_bottom [private] |
Definition at line 20 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_front [private] |
Definition at line 20 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_left [private] |
Definition at line 20 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_right [private] |
Definition at line 20 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_top [private] |
Definition at line 20 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_XDim [private] |
Definition at line 21 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_YDim [private] |
Definition at line 21 of file boundary_functions_lib.h.
double FCubeBoundaryCondition::m_ZDim [private] |
Definition at line 21 of file boundary_functions_lib.h.