FCubeBoundaryCondition Class Reference

#include <boundary_functions_lib.h>

Inheritance diagram for FCubeBoundaryCondition:
Inheritance graph
[legend]
Collaboration diagram for FCubeBoundaryCondition:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

FCubeBoundaryCondition::FCubeBoundaryCondition ( double  xdim,
double  ydim,
double  zdim,
double  left,
double  right,
double  front,
double  back,
double  bottom,
double  top 
)
Parameters:
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)
Returns:

Definition at line 16 of file boundary_functions_lib.cpp.

00017 {
00018   m_XDim = xdim;
00019   m_YDim = ydim;
00020   m_ZDim = zdim;
00021   m_left = left;
00022   m_right = right;
00023   m_top = top;
00024   m_bottom = bottom;
00025   m_front = front;
00026   m_back = back;
00027   _tol=fmin(fmin(m_XDim,m_YDim),m_ZDim)*1.e-07;
00028 }

FCubeBoundaryCondition::~FCubeBoundaryCondition (  )  [inline]

Definition at line 25 of file boundary_functions_lib.h.

00025 {}


Member Function Documentation

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.

Parameters:
p 
component Compoenent of the function.
Returns:

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 }


Member Data Documentation

double FCubeBoundaryCondition::_tol [private]

Definition at line 22 of file boundary_functions_lib.h.

Definition at line 20 of file boundary_functions_lib.h.

Definition at line 20 of file boundary_functions_lib.h.

Definition at line 20 of file boundary_functions_lib.h.

Definition at line 20 of file boundary_functions_lib.h.

Definition at line 20 of file boundary_functions_lib.h.

Definition at line 20 of file boundary_functions_lib.h.

Definition at line 21 of file boundary_functions_lib.h.

Definition at line 21 of file boundary_functions_lib.h.

Definition at line 21 of file boundary_functions_lib.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Sun Apr 8 23:13:05 2012 for CO2INJECTION by  doxygen 1.6.3