FDomainUnion Class Reference

#include <fdomainunion.h>

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

List of all members.

Public Member Functions

 FDomainUnion (Function3D *f1, Function3D *f2, bool delObjs=false)
virtual ~FDomainUnion ()
virtual bool isInDomain (const VecDouble &p, unsigned component=0) const
virtual double operator() (const VecDouble &p, const unsigned int component=0) const

Private Attributes

std::vector< Function3D * > m_functions
bool m_delObjs

Detailed Description

This function makes the union of two functions with non intersecting domains into just one function. If there is an overlapping of the domains, every time we passed a point belonging to this intersection, the FDomainUnion function will return the value of the first function passed to its constructor that has this point inside its domain. Just a remind, the domain for Functions classes is specified by the method Function3d::isInDomain(X) which returns true when the point X is in the domain.

Definition at line 16 of file fdomainunion.h.


Constructor & Destructor Documentation

FDomainUnion::FDomainUnion ( Function3D f1,
Function3D f2,
bool  delObjs = false 
)

Construct a function that is a union between f1 and f2 functions

Parameters:
f1 
f2 
delObjs 
Returns:

Definition at line 9 of file fdomainunion.cpp.

00010 {
00011   m_functions.push_back(f1);
00012   m_functions.push_back(f2);
00013   m_delObjs = delObjs;
00014   
00015 }

FDomainUnion::~FDomainUnion (  )  [virtual]

Definition at line 48 of file fdomainunion.cpp.

00049 {
00050   if (!m_delObjs)
00051     return;
00052   for (unsigned i=0;i<m_functions.size();i++)
00053   {
00054     delete m_functions[i];
00055   }
00056 }


Member Function Documentation

bool FDomainUnion::isInDomain ( const VecDouble p,
unsigned  component = 0 
) const [virtual]

Reimplemented from GeneralFunctionInterface.

Definition at line 22 of file fdomainunion.cpp.

00023 {
00024   for (unsigned i=0;i<m_functions.size();i++)
00025   {
00026     if (m_functions[i]->isInDomain(p,component))
00027       return true;
00028   }
00029   return false;
00030 }

double FDomainUnion::operator() ( const VecDouble p,
const unsigned int  component = 0 
) const [virtual]

Implements GeneralFunctionInterface.

Definition at line 35 of file fdomainunion.cpp.

00036 {
00037   for (unsigned i=0;i<m_functions.size();i++)
00038   {
00039     if (m_functions[i]->isInDomain(p,component))
00040       return (*(m_functions[i]))(p,component);
00041   }
00042   return 0.0;
00043 }


Member Data Documentation

bool FDomainUnion::m_delObjs [private]

Definition at line 20 of file fdomainunion.h.

std::vector<Function3D*> FDomainUnion::m_functions [private]

Definition at line 19 of file fdomainunion.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