MOAB: Mesh Oriented datABase  (version 5.3.1)
moab::SpectralQuad Class Reference

#include <SpectralQuad.hpp>

+ Collaboration diagram for moab::SpectralQuad:

Static Public Member Functions

static ErrorCode evalFcn (const double *params, const double *field, const int ndim, const int num_tuples, double *work, double *result)
 Forward-evaluation of field at parametric coordinates.
static ErrorCode reverseEvalFcn (EvalFcn eval, JacobianFcn jacob, InsideFcn ins, const double *posn, const double *verts, const int nverts, const int ndim, const double iter_tol, const double inside_tol, double *work, double *params, int *is_inside)
 Reverse-evaluation of parametric coordinates at physical space position.
static ErrorCode jacobianFcn (const double *params, const double *verts, const int nverts, const int ndim, double *work, double *result)
 Evaluate the jacobian at a specified parametric position.
static ErrorCode integrateFcn (const double *field, const double *verts, const int nverts, const int ndim, const int num_tuples, double *work, double *result)
 Forward-evaluation of field at parametric coordinates.
static ErrorCode initFcn (const double *verts, const int nverts, double *&work)
 Initialize this EvalSet.
static int insideFcn (const double *params, const int ndim, const double tol)
 Function that returns whether or not the parameters are inside the natural space of the element.
static EvalSet eval_set ()
static bool compatible (EntityType tp, int numv, EvalSet &eset)

Static Protected Attributes

static int _n
static double * _z [2]
static lagrange_data _ld [2]
static opt_data_2 _data
static double * _odwork
static bool _init = false
static double * _glpoints

Detailed Description

Definition at line 12 of file SpectralQuad.hpp.


Member Function Documentation

static bool moab::SpectralQuad::compatible ( EntityType  tp,
int  numv,
EvalSet eset 
) [inline, static]

Definition at line 44 of file SpectralQuad.hpp.

References eval_set(), and MBQUAD.

    {
        if( tp != MBQUAD ) return false;
        int i;
        for( i = 3; i * i == numv || i * i > numv; i++ )
            ;
        if( i * i != numv ) return false;
        eset = eval_set();
        return true;
    }
static EvalSet moab::SpectralQuad::eval_set ( ) [inline, static]

Definition at line 39 of file SpectralQuad.hpp.

Referenced by compatible().

CartVect moab::SpectralQuad::evalFcn ( const double *  params,
const double *  field,
const int  ndim,
const int  num_tuples,
double *  work,
double *  result 
) [static]

Forward-evaluation of field at parametric coordinates.

Definition at line 78 of file SpectralQuad.cpp.

References moab::Element::SpectralQuad::_ld, moab::Element::SpectralQuad::_odwork, moab::Element::SpectralQuad::_xyz, lagrange_0(), n, and tensor_i2().

{
    // piece that we shouldn't want to cache
    int d = 0;
    for( d = 0; d < 2; d++ )
    {
        lagrange_0( &_ld[d], params[d] );
    }
    CartVect result;
    for( d = 0; d < 3; d++ )
    {
        result[d] = tensor_i2( _ld[0].J, _ld[0].n, _ld[1].J, _ld[1].n, _xyz[d], _odwork );
    }
    return result;
}
static ErrorCode moab::SpectralQuad::initFcn ( const double *  verts,
const int  nverts,
double *&  work 
) [static]

Initialize this EvalSet.

int moab::SpectralQuad::insideFcn ( const double *  params,
const int  ndim,
const double  tol 
) [static]

Function that returns whether or not the parameters are inside the natural space of the element.

Definition at line 147 of file SpectralQuad.cpp.

{
    return EvalSet::inside( params, ndim, tol );
}
static ErrorCode moab::SpectralQuad::integrateFcn ( const double *  field,
const double *  verts,
const int  nverts,
const int  ndim,
const int  num_tuples,
double *  work,
double *  result 
) [static]

Forward-evaluation of field at parametric coordinates.

static ErrorCode moab::SpectralQuad::jacobianFcn ( const double *  params,
const double *  verts,
const int  nverts,
const int  ndim,
double *  work,
double *  result 
) [static]

Evaluate the jacobian at a specified parametric position.

bool moab::SpectralQuad::reverseEvalFcn ( EvalFcn  eval,
JacobianFcn  jacob,
InsideFcn  ins,
const double *  posn,
const double *  verts,
const int  nverts,
const int  ndim,
const double  iter_tol,
const double  inside_tol,
double *  work,
double *  params,
int *  is_inside 
) [static]

Reverse-evaluation of parametric coordinates at physical space position.

Definition at line 95 of file SpectralQuad.cpp.

References moab::Element::SpectralQuad::_data, moab::Element::SpectralQuad::_xyz, dist(), init(), opt_findpt_2(), and opt_no_constraints_3.

{
    params = init;

    // find nearest point
    double x_star[3];
    xyz.get( x_star );

    double r[2] = { 0, 0 };  // initial guess for parametric coords
    unsigned c  = opt_no_constraints_3;
    double dist = opt_findpt_2( &_data, (const double**)_xyz, x_star, r, &c );
    // if it did not converge, get out with throw...
    if( dist > 0.9e+30 )
    {
        std::vector< CartVect > dummy;
        throw Map::EvaluationError( CartVect( x_star ), dummy );
    }
    // c tells us if we landed inside the element or exactly on a face, edge, or node
    // also, dist shows the distance to the computed point.
    // copy parametric coords back
    params = r;

    return insideFcn( params, 2, inside_tol );
}

Member Data Documentation

Definition at line 59 of file SpectralQuad.hpp.

real * moab::SpectralQuad::_glpoints [static, protected]

Definition at line 64 of file SpectralQuad.hpp.

bool moab::SpectralQuad::_init = false [static, protected]

Definition at line 63 of file SpectralQuad.hpp.

Definition at line 58 of file SpectralQuad.hpp.

int moab::SpectralQuad::_n [static, protected]

Definition at line 56 of file SpectralQuad.hpp.

real * moab::SpectralQuad::_odwork [static, protected]

Definition at line 60 of file SpectralQuad.hpp.

real * moab::SpectralQuad::_z [static, protected]

Definition at line 57 of file SpectralQuad.hpp.

List of all members.


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