FineCoarseMeshPair< DIM > Class Template Reference

#include <FineCoarseMeshPair.hpp>

Collaboration diagram for FineCoarseMeshPair< DIM >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FineCoarseMeshPair (TetrahedralMesh< DIM, DIM > &rFineMesh, QuadraticMesh< DIM > &rCoarseMesh)
 ~FineCoarseMeshPair ()
void SetUpBoxesOnFineMesh (double boxWidth=-1)
void ComputeFineElementsAndWeightsForCoarseQuadPoints (GaussianQuadratureRule< DIM > &rQuadRule, bool safeMode)
void PrintStatistics ()
std::vector< ElementAndWeights
< DIM > > & 
rGetElementsAndWeights ()
void DeleteBoxCollection ()

Private Attributes

TetrahedralMesh< DIM, DIM > & mrFineMesh
QuadraticMesh< DIM > & mrCoarseMesh
c_vector< double, DIM > mMinValuesFine
c_vector< double, DIM > mMaxValuesFine
BoxCollection< DIM > * mpFineMeshBoxCollection
std::vector< ElementAndWeights
< DIM > > 
mElementsAndWeights
std::vector< unsignedmNotInMesh
std::vector< c_vector< double,
DIM+1 > > 
mNotInMeshNearestElementWeights
std::vector< unsignedmCounters

Friends

class TestFineCoarseMeshPair

Detailed Description

template<unsigned DIM>
class FineCoarseMeshPair< DIM >

Class for a pair of meshes, one fine, one coarse, which should cover the same domain (or very nearly match). This class is used to set up interpolation information from one mesh to the other

Definition at line 58 of file FineCoarseMeshPair.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
FineCoarseMeshPair< DIM >::FineCoarseMeshPair ( TetrahedralMesh< DIM, DIM > &  rFineMesh,
QuadraticMesh< DIM > &  rCoarseMesh 
) [inline]

In some simulations the coarse and fine meshes will turn out to be the same (the vertices of the coarse quadratic mesh will match the vertices of the fine mesh, though the coarse quad mesh will have extra nodes), we should figure out if this is the case and do things differently if so Constructor sets up domain size

Parameters:
rFineMesh Fine mesh (reference)
rCoarseMesh Coarse mesh (reference)

Definition at line 34 of file FineCoarseMeshPair.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), FineCoarseMeshPair< DIM >::mCounters, FineCoarseMeshPair< DIM >::mMaxValuesFine, FineCoarseMeshPair< DIM >::mMinValuesFine, FineCoarseMeshPair< DIM >::mpFineMeshBoxCollection, and FineCoarseMeshPair< DIM >::mrFineMesh.

template<unsigned DIM>
FineCoarseMeshPair< DIM >::~FineCoarseMeshPair (  )  [inline]

Destructor just deletes the box collection

Definition at line 88 of file FineCoarseMeshPair.cpp.

References FineCoarseMeshPair< DIM >::DeleteBoxCollection().


Member Function Documentation

template<unsigned DIM>
void FineCoarseMeshPair< DIM >::ComputeFineElementsAndWeightsForCoarseQuadPoints ( GaussianQuadratureRule< DIM > &  rQuadRule,
bool  safeMode 
) [inline]

Set up the containing (fine) elements and corresponding weights for all the quadrature points in the coarse mesh. Call GetElementsAndWeights() after calling this with the index of the quad point (=the index of the quad point in a QuadraturePointsGroup= the index if the quad points were listed by looping over all the element and then looping over all the quad points).

Parameters:
rQuadRule The quadrature rule, used to determine the number of quadrature points per element.
safeMode This method uses the elements in the boxes to guess which element a quad point is in. If a quad point is in none of these elements, then if safeMode==true, it will then search the whole mesh. If safeMode==false it will assume the immediately the quad point isn't in the mesh at all. safeMode=false is will far more efficient with big meshes. It should be fine to use safeMode=false if SetUpBoxesOnFineMesh() is called with default values.

Definition at line 164 of file FineCoarseMeshPair.cpp.

References QuadraturePointsGroup< DIM >::Get(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetContainingElementIndex(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNearestElementIndexFromTestElements(), FineCoarseMeshPair< DIM >::mCounters, FineCoarseMeshPair< DIM >::mElementsAndWeights, FineCoarseMeshPair< DIM >::mNotInMesh, FineCoarseMeshPair< DIM >::mNotInMeshNearestElementWeights, FineCoarseMeshPair< DIM >::mpFineMeshBoxCollection, FineCoarseMeshPair< DIM >::mrCoarseMesh, FineCoarseMeshPair< DIM >::mrFineMesh, ChastePoint< DIM >::rGetLocation(), and QuadraturePointsGroup< DIM >::Size().

template<unsigned DIM>
void FineCoarseMeshPair< DIM >::DeleteBoxCollection (  )  [inline]

Destroy the box collection - can be used to free memory once ComputeFineElementsAndWeightsForCoarseQuadPoints has been called.

Definition at line 351 of file FineCoarseMeshPair.cpp.

References FineCoarseMeshPair< DIM >::mpFineMeshBoxCollection.

Referenced by FineCoarseMeshPair< DIM >::~FineCoarseMeshPair().

template<unsigned DIM>
void FineCoarseMeshPair< DIM >::PrintStatistics (  )  [inline]

Print the number of points for which the containing element was found quickly, the number for which the containing element was found slowly, and the number for which no containing element was found (with the values of the weights for the latter).

Definition at line 330 of file FineCoarseMeshPair.cpp.

References FineCoarseMeshPair< DIM >::mCounters, FineCoarseMeshPair< DIM >::mNotInMesh, and FineCoarseMeshPair< DIM >::mNotInMeshNearestElementWeights.

template<unsigned DIM>
std::vector<ElementAndWeights<DIM> >& FineCoarseMeshPair< DIM >::rGetElementsAndWeights (  )  [inline]
Returns:
A reference to the elements/weights information

Definition at line 152 of file FineCoarseMeshPair.hpp.

References FineCoarseMeshPair< DIM >::mElementsAndWeights.

template<unsigned DIM>
void FineCoarseMeshPair< DIM >::SetUpBoxesOnFineMesh ( double  boxWidth = -1  )  [inline]

Set up boxes on fine mesh. The elements contained in each box is stored, which makes finding the containing element for a given point much faster. This should be called before ComputeFineElementsAndWeightsForCoarseQuadPoints() etc

Parameters:
boxWidth width to use for the boxes (which will be cubes). Note that a domain which is a touch larger than the smallest containing cuboid of the fine mesh is used. boxWidth defaults to a negative value, in which case a box width such that there are approximately 20 boxes in the x-direction, unless this width is less than maximum (fine mesh edge length), in which case it is chosen accordingly.

Definition at line 94 of file FineCoarseMeshPair.cpp.

References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::EdgesBegin(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::EdgesEnd(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), FineCoarseMeshPair< DIM >::mMaxValuesFine, FineCoarseMeshPair< DIM >::mMinValuesFine, FineCoarseMeshPair< DIM >::mpFineMeshBoxCollection, and FineCoarseMeshPair< DIM >::mrFineMesh.


Member Data Documentation

template<unsigned DIM>
std::vector<unsigned> FineCoarseMeshPair< DIM >::mCounters [private]

3 values, (0) number of points for which the containing element was found quickly (the element was in the same box as the point, (1) number of points for which the containing element was found slowly (the element was not the same box as the point, (2) num points outside the fine mesh. Note mCounters[2] = mNotInMesh.size() = mNotInMeshNearestElementWeights.size();

Definition at line 91 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::ComputeFineElementsAndWeightsForCoarseQuadPoints(), FineCoarseMeshPair< DIM >::FineCoarseMeshPair(), and FineCoarseMeshPair< DIM >::PrintStatistics().

template<unsigned DIM>
std::vector<ElementAndWeights<DIM> > FineCoarseMeshPair< DIM >::mElementsAndWeights [private]

The containing elements and corresponding weights in the fine mesh for the set of points given. The points may have been quadrature points in the coarse mesh, or nodes in coarse mesh, etc.

Definition at line 78 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::ComputeFineElementsAndWeightsForCoarseQuadPoints(), and FineCoarseMeshPair< DIM >::rGetElementsAndWeights().

template<unsigned DIM>
c_vector<double,DIM> FineCoarseMeshPair< DIM >::mMaxValuesFine [private]

The max values of the nodes, for each dimension, in the fine mesh, for creating the boxes

Definition at line 71 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::FineCoarseMeshPair(), and FineCoarseMeshPair< DIM >::SetUpBoxesOnFineMesh().

template<unsigned DIM>
c_vector<double,DIM> FineCoarseMeshPair< DIM >::mMinValuesFine [private]

The min values of the nodes, for each dimension, in the fine mesh, for creating the boxes

Definition at line 69 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::FineCoarseMeshPair(), and FineCoarseMeshPair< DIM >::SetUpBoxesOnFineMesh().

template<unsigned DIM>
std::vector<unsigned> FineCoarseMeshPair< DIM >::mNotInMesh [private]

Indices of the points which were found to be outside the fine mesh

Definition at line 81 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::ComputeFineElementsAndWeightsForCoarseQuadPoints(), and FineCoarseMeshPair< DIM >::PrintStatistics().

template<unsigned DIM>
std::vector<c_vector<double,DIM+1> > FineCoarseMeshPair< DIM >::mNotInMeshNearestElementWeights [private]

The corresponding weights, for the nearest elements, of the points which were found to be outside the fine mesh

Definition at line 84 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::ComputeFineElementsAndWeightsForCoarseQuadPoints(), and FineCoarseMeshPair< DIM >::PrintStatistics().

template<unsigned DIM>
BoxCollection<DIM>* FineCoarseMeshPair< DIM >::mpFineMeshBoxCollection [private]
template<unsigned DIM>
QuadraticMesh<DIM>& FineCoarseMeshPair< DIM >::mrCoarseMesh [private]

Coarse mesh (usually be a quadratic mesh)

Definition at line 66 of file FineCoarseMeshPair.hpp.

Referenced by FineCoarseMeshPair< DIM >::ComputeFineElementsAndWeightsForCoarseQuadPoints().

template<unsigned DIM>
TetrahedralMesh<DIM,DIM>& FineCoarseMeshPair< DIM >::mrFineMesh [private]

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

Generated by  doxygen 1.6.2