Back to index

salome-med  6.5.0
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
INTERP_KERNEL::SplitterTetra< MyMeshType > Class Template Reference

Class calculating the volume of intersection between a tetrahedral target element and source elements with triangular or quadratilateral faces. More...

#include <SplitterTetra.hxx>

Collaboration diagram for INTERP_KERNEL::SplitterTetra< MyMeshType >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SplitterTetra (const MyMeshType &srcMesh, const double **tetraCorners, const typename MyMeshType::MyConnType *nodesId)
 ~SplitterTetra ()
double intersectSourceCell (typename MyMeshType::MyConnType srcCell, double *baryCentre=0)
double intersectSourceFace (const NormalizedCellType polyType, const int polyNodesNbr, const int *const polyNodes, const double *const *const polyCoords, const double dimCaracteristic, const double precision, std::multiset< TriangleFaceKey > &listOfTetraFacesTreated, std::set< TriangleFaceKey > &listOfTetraFacesColinear)
double intersectTetra (const double **tetraCorners)
MyMeshType::MyConnType getId (int id)
void splitIntoDualCells (SplitterTetra< MyMeshType > **output)
void splitMySelfForDual (double *output, int i, typename MyMeshType::MyConnType &nodeId)
void clearVolumesCache ()

Private Member Functions

void createAffineTransform (const double **corners)
 Creates the affine transform _t from the corners of the tetrahedron.
void checkIsOutside (const double *pt, bool *isOutside, const double errTol=DEFAULT_ABS_TOL) const
 Function used to filter out elements by checking if they belong to one of the halfspaces x <= 0, x >= 1, y <= 0, y >= 1, z <= 0, z >= 1, (indexed 0 - 7).
void checkIsStrictlyOutside (const double *pt, bool *isStrictlyOutside, const double errTol=DEFAULT_ABS_TOL) const
void calculateNode (typename MyMeshType::MyConnType globalNodeNum)
 Calculates the transformed node with a given global node number.
void calculateNode2 (typename MyMeshType::MyConnType globalNodeNum, const double *node)
 Calculates the transformed node with a given global node number.
void calculateVolume (TransformedTriangle &tri, const TriangleFaceKey &key)
 Calculates the volume contribution from the given TransformedTriangle and stores it with the given key in .
void calculateSurface (TransformedTriangle &tri, const TriangleFaceKey &key)
 Calculates the surface contribution from the given TransformedTriangle and stores it with the given key in.
 SplitterTetra (const SplitterTetra &t)
 disallow copying
SplitterTetraoperator= (const SplitterTetra &t)
 disallow assignment

Static Private Member Functions

static bool IsFacesCoplanar (const double *const planeNormal, const double planeConstant, const double *const *const coordsFace, const double precision)
static double CalculateIntersectionSurfaceOfCoplanarTriangles (const double *const planeNormal, const double planeConstant, const double *const p1, const double *const p2, const double *const p3, const double *const p4, const double *const p5, const double *const p6, const double dimCaracteristic, const double precision)

Private Attributes

TetraAffineTransform * _t
 affine transform associated with this target element
HashMap< int, double * > _nodes
 HashMap relating node numbers to transformed nodes, used for caching.
HashMap< TriangleFaceKey, double > _volumes
 HashMap relating triangular faces to calculated volume contributions, used for caching.
const MyMeshType & _src_mesh
 reference to the source mesh
MyMeshType::MyConnType _conn [4]
double _coords [12]

Detailed Description

template<class MyMeshType>
class INTERP_KERNEL::SplitterTetra< MyMeshType >

Class calculating the volume of intersection between a tetrahedral target element and source elements with triangular or quadratilateral faces.

Definition at line 191 of file SplitterTetra.hxx.


Constructor & Destructor Documentation

template<class MyMeshType>
INTERP_KERNEL::SplitterTetra< MyMeshType >::SplitterTetra ( const MyMeshType &  srcMesh,
const double **  tetraCorners,
const typename MyMeshType::MyConnType *  nodesId 
)
template<class MyMeshType>
INTERP_KERNEL::SplitterTetra< MyMeshType >::~SplitterTetra ( )
template<class MyMeshType>
INTERP_KERNEL::SplitterTetra< MyMeshType >::SplitterTetra ( const SplitterTetra< MyMeshType > &  t) [private]

disallow copying


Member Function Documentation

template<class MyMeshType>
static double INTERP_KERNEL::SplitterTetra< MyMeshType >::CalculateIntersectionSurfaceOfCoplanarTriangles ( const double *const  planeNormal,
const double  planeConstant,
const double *const  p1,
const double *const  p2,
const double *const  p3,
const double *const  p4,
const double *const  p5,
const double *const  p6,
const double  dimCaracteristic,
const double  precision 
) [inline, static, private]
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::calculateNode ( typename MyMeshType::MyConnType  globalNodeNum) [inline, private]

Calculates the transformed node with a given global node number.

Gets the coordinates for the node in _src_mesh with the given global number and applies TetraAffineTransform _t to it. Stores the result in the cache _nodes. The non-existance of the node in _nodes should be verified before calling.

Parameters:
globalNodeNumglobal node number of the node in the mesh _src_mesh

Definition at line 324 of file SplitterTetra.hxx.

  {  
    const double* node = _src_mesh.getCoordinatesPtr()+MyMeshType::MY_SPACEDIM*globalNodeNum;
    double* transformedNode = new double[MyMeshType::MY_SPACEDIM];
    assert(transformedNode != 0);
    _t->apply(transformedNode, node);
    _nodes[globalNodeNum] = transformedNode;
  }
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::calculateNode2 ( typename MyMeshType::MyConnType  globalNodeNum,
const double *  node 
) [inline, private]

Calculates the transformed node with a given global node number.

Applies TetraAffineTransform * _t to it. Stores the result in the cache _nodes. The non-existence of the node in _nodes should be verified before * calling. The only difference with the previous method calculateNode is that the coordinates of the node are passed in arguments and are not recalculated in order to optimize the method.

Parameters:
globalNodeNumglobal node number of the node in the mesh _src_mesh

Definition at line 345 of file SplitterTetra.hxx.

  {
    double* transformedNode = new double[MyMeshType::MY_SPACEDIM];
    assert(transformedNode != 0);
    _t->apply(transformedNode, node);
    _nodes[globalNodeNum] = transformedNode;
  }
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::calculateSurface ( TransformedTriangle tri,
const TriangleFaceKey key 
) [inline, private]

Calculates the surface contribution from the given TransformedTriangle and stores it with the given key in.

Calls TransformedTriangle::calculateIntersectionSurface to perform the calculation.

Parameters:
tritriangle for which to calculate the surface contribution
keykey associated with the face

Definition at line 375 of file SplitterTetra.hxx.

  {
    const double surf = tri.calculateIntersectionSurface(_t);
    _volumes.insert(std::make_pair(key, surf));
  }
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::calculateVolume ( TransformedTriangle tri,
const TriangleFaceKey key 
) [inline, private]

Calculates the volume contribution from the given TransformedTriangle and stores it with the given key in .

Calls TransformedTriangle::calculateIntersectionVolume to perform the calculation.

Parameters:
tritriangle for which to calculate the volume contribution
keykey associated with the face

Definition at line 361 of file SplitterTetra.hxx.

  {
    const double vol = tri.calculateIntersectionVolume();
    _volumes.insert(std::make_pair(key, vol));
  }
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::checkIsOutside ( const double *  pt,
bool *  isOutside,
const double  errTol = DEFAULT_ABS_TOL 
) const [inline, private]

Function used to filter out elements by checking if they belong to one of the halfspaces x <= 0, x >= 1, y <= 0, y >= 1, z <= 0, z >= 1, (indexed 0 - 7).

The function updates an array of boolean variables which indicates whether the points that have already been checked are all in a halfspace. For each halfspace, the corresponding array element will be true if and only if it was true when the method was called and pt lies in the halfspace.

Parameters:
ptdouble[3] containing the coordiantes of a transformed point
isOutsidebool[8] which indicate the results of earlier checks.

Definition at line 289 of file SplitterTetra.hxx.

  {
    isOutside[0] = isOutside[0] && (pt[0] < errTol);
    isOutside[1] = isOutside[1] && (pt[0] > (1.0-errTol) );
    isOutside[2] = isOutside[2] && (pt[1] < errTol);
    isOutside[3] = isOutside[3] && (pt[1] > (1.0-errTol));
    isOutside[4] = isOutside[4] && (pt[2] < errTol);
    isOutside[5] = isOutside[5] && (pt[2] > (1.0-errTol));
    isOutside[6] = isOutside[6] && (1.0 - pt[0] - pt[1] - pt[2] < errTol);
    isOutside[7] = isOutside[7] && (1.0 - pt[0] - pt[1] - pt[2] > (1.0-errTol) );
  }
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::checkIsStrictlyOutside ( const double *  pt,
bool *  isStrictlyOutside,
const double  errTol = DEFAULT_ABS_TOL 
) const [inline, private]

Definition at line 302 of file SplitterTetra.hxx.

  {
    isStrictlyOutside[0] = isStrictlyOutside[0] && (pt[0] < -errTol);
    isStrictlyOutside[1] = isStrictlyOutside[1] && (pt[0] > (1.0 + errTol));
    isStrictlyOutside[2] = isStrictlyOutside[2] && (pt[1] < -errTol);
    isStrictlyOutside[3] = isStrictlyOutside[3] && (pt[1] > (1.0 + errTol));
    isStrictlyOutside[4] = isStrictlyOutside[4] && (pt[2] < -errTol);
    isStrictlyOutside[5] = isStrictlyOutside[5] && (pt[2] > (1.0 + errTol));
    isStrictlyOutside[6] = isStrictlyOutside[6] && (1.0 - pt[0] - pt[1] - pt[2] < -errTol);
    isStrictlyOutside[7] = isStrictlyOutside[7] && (1.0 - pt[0] - pt[1] - pt[2] > (1.0 + errTol));
  }
template<class MyMeshType>
void INTERP_KERNEL::SplitterTetra< MyMeshType >::clearVolumesCache ( )
template<class MyMeshType >
void INTERP_KERNEL::SplitterTetra< MyMeshType >::createAffineTransform ( const double **  corners) [inline, private]

Creates the affine transform _t from the corners of the tetrahedron.

Used by the constructors

Parameters:
cornersdouble*[4] array containing pointers to four double[3] arrays with the coordinates of the corners of the tetrahedron

Definition at line 273 of file SplitterTetra.hxx.

  {
    // create AffineTransform from tetrahedron
    _t = new TetraAffineTransform( corners );
  }
template<class MyMeshType>
MyMeshType::MyConnType INTERP_KERNEL::SplitterTetra< MyMeshType >::getId ( int  id) [inline]

Definition at line 211 of file SplitterTetra.hxx.

{ return _conn[id]; }
template<class MyMeshType>
double INTERP_KERNEL::SplitterTetra< MyMeshType >::intersectSourceCell ( typename MyMeshType::MyConnType  srcCell,
double *  baryCentre = 0 
)
template<class MyMeshType>
double INTERP_KERNEL::SplitterTetra< MyMeshType >::intersectSourceFace ( const NormalizedCellType  polyType,
const int  polyNodesNbr,
const int *const  polyNodes,
const double *const *const  polyCoords,
const double  dimCaracteristic,
const double  precision,
std::multiset< TriangleFaceKey > &  listOfTetraFacesTreated,
std::set< TriangleFaceKey > &  listOfTetraFacesColinear 
)
template<class MyMeshType>
double INTERP_KERNEL::SplitterTetra< MyMeshType >::intersectTetra ( const double **  tetraCorners)
template<class MyMeshType>
static bool INTERP_KERNEL::SplitterTetra< MyMeshType >::IsFacesCoplanar ( const double *const  planeNormal,
const double  planeConstant,
const double *const *const  coordsFace,
const double  precision 
) [inline, static, private]
template<class MyMeshType>
SplitterTetra& INTERP_KERNEL::SplitterTetra< MyMeshType >::operator= ( const SplitterTetra< MyMeshType > &  t) [private]

disallow assignment

template<class MyMeshType>
void INTERP_KERNEL::SplitterTetra< MyMeshType >::splitIntoDualCells ( SplitterTetra< MyMeshType > **  output)
template<class MyMeshType>
void INTERP_KERNEL::SplitterTetra< MyMeshType >::splitMySelfForDual ( double *  output,
int  i,
typename MyMeshType::MyConnType &  nodeId 
)

Member Data Documentation

template<class MyMeshType>
MyMeshType::MyConnType INTERP_KERNEL::SplitterTetra< MyMeshType >::_conn[4] [private]

Definition at line 261 of file SplitterTetra.hxx.

template<class MyMeshType>
double INTERP_KERNEL::SplitterTetra< MyMeshType >::_coords[12] [private]

Definition at line 263 of file SplitterTetra.hxx.

template<class MyMeshType>
HashMap< int , double* > INTERP_KERNEL::SplitterTetra< MyMeshType >::_nodes [private]

HashMap relating node numbers to transformed nodes, used for caching.

Definition at line 248 of file SplitterTetra.hxx.

template<class MyMeshType>
const MyMeshType& INTERP_KERNEL::SplitterTetra< MyMeshType >::_src_mesh [private]

reference to the source mesh

Definition at line 258 of file SplitterTetra.hxx.

template<class MyMeshType>
TetraAffineTransform* INTERP_KERNEL::SplitterTetra< MyMeshType >::_t [private]

affine transform associated with this target element

Definition at line 245 of file SplitterTetra.hxx.

template<class MyMeshType>
HashMap< TriangleFaceKey, double > INTERP_KERNEL::SplitterTetra< MyMeshType >::_volumes [private]

HashMap relating triangular faces to calculated volume contributions, used for caching.

Definition at line 255 of file SplitterTetra.hxx.


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