MOAB: Mesh Oriented datABase  (version 5.4.1)
geomObject Class Reference
+ 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

virtual geomObject::~geomObject ( ) [inline, virtual]

Definition at line 9 of file geomObject.cpp.

{}

Member Function Documentation

virtual double geomObject::compute_projecterror ( int  dim,
double *  oldcoords 
) const [inline, virtual]

Definition at line 11 of file geomObject.cpp.

References dim, and project_points2geom().

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

    {
        double* newcoords = new double[dim]();
        project_points2geom( dim, oldcoords, newcoords, NULL );
        double ans = 0;

        for( int i = 0; i < dim; ++i )
        {
            ans += ( newcoords[i] - oldcoords[i] ) * ( newcoords[i] - oldcoords[i] );
        }

        delete[] newcoords;
        return sqrt( ans );
    }
virtual void geomObject::compute_projecterror ( int  dim,
int  nverts,
double *  oldcoords,
double &  l1err,
double &  l2err,
double &  linferr 
) const [inline, virtual]

Definition at line 25 of file geomObject.cpp.

References compute_projecterror().

    {
        l1err = l2err = linferr = 0;

        for( int i = 0; i < nverts; ++i )
        {
            double err = compute_projecterror( dim, oldcoords + i * dim );
            l1err += err;
            l2err += err * err;
            linferr = std::max( linferr, err );
        }

        l1err /= nverts;
        l2err = sqrt( l2err / nverts );
    }
virtual void geomObject::project_points2geom ( int  dim,
double *  oldcoords,
double *  newcoords,
double *  derivs 
) const [pure virtual]
double geomObject::Twonorm ( int  dim,
double *  vec 
) const [inline]

Definition at line 45 of file geomObject.cpp.

References dim.

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

    {
        double ans = 0;

        for( int i = 0; i < dim; ++i )
        {
            ans += vec[i] * vec[i];
        }

        return sqrt( ans );
    }

List of all members.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines