MOAB: Mesh Oriented datABase  (version 5.5.0)
geomObject Class Referenceabstract
+ Inheritance diagram for geomObject:

Public Member Functions

virtual ~geomObject ()
 
virtual void project_points2geom (int dim, double *oldcoords, double *newcoords, double *derivs) const =0
 
virtual double compute_projecterror (int dim, double *oldcoords) const
 
virtual void compute_projecterror (int dim, int nverts, double *oldcoords, double &l1err, double &l2err, double &linferr) const
 
double Twonorm (int dim, double *vec) const
 

Detailed Description

Definition at line 6 of file geomObject.cpp.

Constructor & Destructor Documentation

◆ ~geomObject()

virtual geomObject::~geomObject ( )
inlinevirtual

Definition at line 9 of file geomObject.cpp.

9 {}

Member Function Documentation

◆ compute_projecterror() [1/2]

virtual double geomObject::compute_projecterror ( int  dim,
double *  oldcoords 
) const
inlinevirtual

Definition at line 11 of file geomObject.cpp.

12  {
13  double* newcoords = new double[dim]();
14  project_points2geom( dim, oldcoords, newcoords, NULL );
15  double ans = 0;
16 
17  for( int i = 0; i < dim; ++i )
18  {
19  ans += ( newcoords[i] - oldcoords[i] ) * ( newcoords[i] - oldcoords[i] );
20  }
21 
22  delete[] newcoords;
23  return sqrt( ans );
24  }

References dim, and project_points2geom().

Referenced by closedsurface_uref_hirec_convergence_study(), compute_projecterror(), and test_closedsurface_mesh().

◆ compute_projecterror() [2/2]

virtual void geomObject::compute_projecterror ( int  dim,
int  nverts,
double *  oldcoords,
double &  l1err,
double &  l2err,
double &  linferr 
) const
inlinevirtual

Definition at line 25 of file geomObject.cpp.

31  {
32  l1err = l2err = linferr = 0;
33 
34  for( int i = 0; i < nverts; ++i )
35  {
36  double err = compute_projecterror( dim, oldcoords + i * dim );
37  l1err += err;
38  l2err += err * err;
39  linferr = std::max( linferr, err );
40  }
41 
42  l1err /= nverts;
43  l2err = sqrt( l2err / nverts );
44  }

References compute_projecterror(), and dim.

◆ project_points2geom()

virtual void geomObject::project_points2geom ( int  dim,
double *  oldcoords,
double *  newcoords,
double *  derivs 
) const
pure virtual

◆ Twonorm()

double geomObject::Twonorm ( int  dim,
double *  vec 
) const
inline

Definition at line 45 of file geomObject.cpp.

46  {
47  double ans = 0;
48 
49  for( int i = 0; i < dim; ++i )
50  {
51  ans += vec[i] * vec[i];
52  }
53 
54  return sqrt( ans );
55  }

References dim.

Referenced by sphere::project_points2geom(), and torus::project_points2geom().


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