Back to index

salome-med  6.5.0
Public Member Functions | Public Attributes
INTERP_TEST::PerfTestToolkit Class Reference

Specialization of MeshTestToolkit for the purposes of performance testing. More...

Inheritance diagram for INTERP_TEST::PerfTestToolkit:
Inheritance graph
[legend]
Collaboration diagram for INTERP_TEST::PerfTestToolkit:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void calcIntersectionMatrix (const char *mesh1path, const char *mesh1, const char *mesh2path, const char *mesh2, IntersectionMatrix &m)
 Calculates the intersection matrix for two meshes.
std::pair< int, int > countNumberOfMatrixEntries (const IntersectionMatrix &m)
 Counts the number of elements in an intersection matrix, and the number of these which are non-zero.
void intersectMeshes (const char *mesh1, const char *mesh2, const double correctVol, const double prec=1.0e-5, bool doubleTest=true) const
void intersectMeshes (const char *mesh1path, const char *mesh1, const char *mesh2path, const char *mesh2, const double correctVol, const double prec=1.0e-5, bool doubleTest=true) const
void dumpIntersectionMatrix (const IntersectionMatrix &m) const
double sumRow (const IntersectionMatrix &m, int i) const
double sumCol (const IntersectionMatrix &m, int i) const
void getVolumes (MEDMEM::MESH &mesh, double *tab) const
bool testVolumes (const IntersectionMatrix &m, MEDMEM::MESH &sMesh, MEDMEM::MESH &tMesh) const
double sumVolume (const IntersectionMatrix &m) const
bool areCompatitable (const IntersectionMatrix &m1, const IntersectionMatrix &m2) const
bool testTranspose (const IntersectionMatrix &m1, const IntersectionMatrix &m2) const
bool testDiagonal (const IntersectionMatrix &m) const
void calcIntersectionMatrix (const char *mesh1path, const char *mesh1, const char *mesh2path, const char *mesh2, IntersectionMatrix &m) const

Public Attributes

double _precision
INTERP_KERNEL::IntersectionType _intersectionType

Detailed Description

Specialization of MeshTestToolkit for the purposes of performance testing.

Definition at line 52 of file PerfTest.cxx.


Member Function Documentation

bool INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::areCompatitable ( const IntersectionMatrix m1,
const IntersectionMatrix m2 
) const [inherited]
void INTERP_TEST::PerfTestToolkit::calcIntersectionMatrix ( const char *  mesh1path,
const char *  mesh1,
const char *  mesh2path,
const char *  mesh2,
IntersectionMatrix m 
) [inline]

Calculates the intersection matrix for two meshes.

Outputs the names of the meshes intersected, the number of elements in each mesh, the number of matrix elements and the number of non-zero matrix elements, etc. These values help to determine how well the filtering algorithm is working.

Parameters:
mesh1paththe path to the file containing the source mesh, relative to {$MED_ROOT_DIR}/share/salome/resources/med/
mesh1the name of the source mesh
mesh2paththe path to the file containing the target mesh, relative to {$MED_ROOT_DIR}/share/salome/resources/med/
mesh2the name of the target mesh
mintersection matrix in which to store the result of the intersection

Definition at line 69 of file PerfTest.cxx.

    {
      LOG(1, std::endl << "=== -> intersecting src = " << mesh1 << ", target = " << mesh2 );
      
      LOG(5, "Loading " << mesh1 << " from " << mesh1path);
      const MESH sMesh(MED_DRIVER, INTERP_TEST::getResourceFile(mesh1path), mesh1);
    
    
      LOG(5, "Loading " << mesh2 << " from " << mesh2path);
      const MESH tMesh(MED_DRIVER, INTERP_TEST::getResourceFile(mesh2path), mesh2);
      
      MEDNormalizedUnstructuredMesh<3,3> sMesh_wrapper(&sMesh);
      MEDNormalizedUnstructuredMesh<3,3> tMesh_wrapper(&tMesh);
      
      Interpolation3D interpolator;
      interpolator.interpolateMeshes(sMesh_wrapper, tMesh_wrapper,m,"P0P0");
    
      std::pair<int, int> eff = countNumberOfMatrixEntries(m);
      LOG(1, eff.first << " of " << numTargetElems * numSrcElems << " intersections calculated : ratio = " 
          << double(eff.first) / double(numTargetElems * numSrcElems));
      LOG(1, eff.second << " non-zero elements of " << eff.first << " total : filter efficiency = " 
          << double(eff.second) / double(eff.first));
    
      LOG(1, "Intersection calculation done. " << std::endl );
    
    }

Here is the call graph for this function:

void INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::calcIntersectionMatrix ( const char *  mesh1path,
const char *  mesh1,
const char *  mesh2path,
const char *  mesh2,
IntersectionMatrix m 
) const [inherited]

Counts the number of elements in an intersection matrix, and the number of these which are non-zero.

Parameters:
mthe intersection matrix
Returns:
pair<int, int> containing as its first element the number of elements in m and as its second element the number these which are non-zero

Definition at line 103 of file PerfTest.cxx.

    {
      
      int numElems = 0;
      int numNonZero = 0;
      for(IntersectionMatrix::const_iterator iter = m.begin() ; iter != m.end() ; ++iter)
        {
          numElems += iter->size();
          for(map<int, double>::const_iterator iter2 = iter->begin() ; iter2 != iter->end() ; ++iter2)
            {
              if(!INTERP_KERNEL::epsilonEqual(iter2->second, 0.0, VOL_PREC))
                {
                  ++numNonZero;
                }
            }
        }
      return std::make_pair(numElems, numNonZero);
    }

Here is the call graph for this function:

void INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::dumpIntersectionMatrix ( const IntersectionMatrix m) const [inherited]
void INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::getVolumes ( MEDMEM::MESH &  mesh,
double *  tab 
) const [inherited]
void INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::intersectMeshes ( const char *  mesh1,
const char *  mesh2,
const double  correctVol,
const double  prec = 1.0e-5,
bool  doubleTest = true 
) const [inherited]
void INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::intersectMeshes ( const char *  mesh1path,
const char *  mesh1,
const char *  mesh2path,
const char *  mesh2,
const double  correctVol,
const double  prec = 1.0e-5,
bool  doubleTest = true 
) const [inherited]
double INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::sumCol ( const IntersectionMatrix m,
int  i 
) const [inherited]
double INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::sumRow ( const IntersectionMatrix m,
int  i 
) const [inherited]
double INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::sumVolume ( const IntersectionMatrix m) const [inherited]
bool INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::testDiagonal ( const IntersectionMatrix m) const [inherited]
bool INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::testTranspose ( const IntersectionMatrix m1,
const IntersectionMatrix m2 
) const [inherited]
bool INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::testVolumes ( const IntersectionMatrix m,
MEDMEM::MESH &  sMesh,
MEDMEM::MESH &  tMesh 
) const [inherited]

Member Data Documentation

Definition at line 56 of file MeshTestToolkit.hxx.

double INTERP_TEST::MeshTestToolkit< SPACEDIM, MESHDIM >::_precision [inherited]

Definition at line 55 of file MeshTestToolkit.hxx.


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