DegreeOfFreedomSetManager::Internal Class Reference

List of all members.

Public Member Functions

ConstReferenceCounting
< ScalarDegreeOfFreedomPositionsSet
getDOFPositionsSet (const Mesh &mesh, const ScalarDiscretizationTypeBase &discretizationType)
void unsubscribe (ConstReferenceCounting< ScalarDegreeOfFreedomPositionsSet > dofSet)
 Internal ()
 ~Internal ()

Private Types

typedef std::string DiscretizationLabel
typedef std::map< std::pair
< const Mesh
*, DiscretizationLabel >
, std::pair< size_t,
ScalarDegreeOfFreedomPositionsSet * > > 
MeshesDOFPositionsCorrespondance

Private Attributes

MeshesDOFPositionsCorrespondance __meshesDOFPositions


Detailed Description

Definition at line 34 of file DegreeOfFreedomSetManager.cpp.


Member Typedef Documentation

Definition at line 37 of file DegreeOfFreedomSetManager.cpp.

Definition at line 42 of file DegreeOfFreedomSetManager.cpp.


Constructor & Destructor Documentation

DegreeOfFreedomSetManager::Internal::Internal (  )  [inline]

Definition at line 99 of file DegreeOfFreedomSetManager.cpp.

00100   {
00101     ;
00102   }

DegreeOfFreedomSetManager::Internal::~Internal (  )  [inline]

Definition at line 104 of file DegreeOfFreedomSetManager.cpp.

References __meshesDOFPositions, and fferr().

00105   {
00106     if (__meshesDOFPositions.size() > 0) {
00107       fferr(1) << __FILE__ << ':' << __LINE__
00108                << ":warning: degrees of freedom set manager is not empty!\n";
00109     }
00110   }

Here is the call graph for this function:


Member Function Documentation

ConstReferenceCounting<ScalarDegreeOfFreedomPositionsSet> DegreeOfFreedomSetManager::Internal::getDOFPositionsSet ( const Mesh mesh,
const ScalarDiscretizationTypeBase discretizationType 
) [inline]

Definition at line 48 of file DegreeOfFreedomSetManager.cpp.

References __meshesDOFPositions, ScalarDiscretizationTypeSpectral::degrees(), ScalarDiscretizationTypeBase::name(), ScalarDiscretizationTypeBase::spectralLegendre, stringify(), and ScalarDiscretizationTypeBase::type().

Referenced by DegreeOfFreedomSetManager::getDOFPositionsSet().

00050   {
00051     DiscretizationLabel label = ScalarDiscretizationTypeBase::name(discretizationType);
00052 
00053     switch (discretizationType.type()) {
00054     case ScalarDiscretizationTypeBase::spectralLegendre: {
00055       const ScalarDiscretizationTypeSpectral& spectralDiscretizationType
00056         = dynamic_cast<const ScalarDiscretizationTypeSpectral&>(discretizationType);
00057       label += "-"+stringify(spectralDiscretizationType.degrees());
00058       break;
00059     }
00060     default: {
00061     }
00062     }
00063 
00064     MeshesDOFPositionsCorrespondance::iterator
00065       i = __meshesDOFPositions.find(std::make_pair(&mesh,label));
00066 
00067     if (i != __meshesDOFPositions.end()) {
00068       (*i).second.first++;
00069       return (*i).second.second;
00070     } else {
00071       ScalarDegreeOfFreedomPositionsSet* dof
00072         = new ScalarDegreeOfFreedomPositionsSet(discretizationType,mesh);
00073 
00074       __meshesDOFPositions[std::make_pair(&mesh, label)]
00075         = std::make_pair(1,dof);
00076       return dof;
00077     }
00078   }

Here is the call graph for this function:

void DegreeOfFreedomSetManager::Internal::unsubscribe ( ConstReferenceCounting< ScalarDegreeOfFreedomPositionsSet dofSet  )  [inline]

Definition at line 80 of file DegreeOfFreedomSetManager.cpp.

References __meshesDOFPositions, and ErrorHandler::unexpected.

Referenced by DegreeOfFreedomSetManager::unsubscribe().

00081   {
00082     for (MeshesDOFPositionsCorrespondance::iterator i
00083            = __meshesDOFPositions.begin();
00084          i != __meshesDOFPositions.end(); ++i) {
00085       if ((*i).second.second == dofSet) {
00086         (*i).second.first--;
00087         if ((*i).second.first == 0) {
00088           __meshesDOFPositions.erase(i);
00089         }
00090         return;
00091       }
00092     }
00093     throw ErrorHandler(__FILE__,__LINE__,
00094                        "DOF Set not found!",
00095                        ErrorHandler::unexpected);
00096 
00097   }


Member Data Documentation

Definition at line 44 of file DegreeOfFreedomSetManager.cpp.

Referenced by getDOFPositionsSet(), unsubscribe(), and ~Internal().


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

Generated on Wed Nov 19 00:05:32 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6