Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
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. More...
 
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. More...
 
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. More...
 
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. More...
 
static ErrorCode initFcn (const double *verts, const int nverts, double *&work)
 Initialize this EvalSet. More...
 
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. More...
 
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

◆ compatible()

static bool moab::SpectralQuad::compatible ( EntityType  tp,
int  numv,
EvalSet eset 
)
inlinestatic

Definition at line 66 of file SpectralQuad.hpp.

67  {
68  if( tp != MBQUAD ) return false;
69  int i;
70  for( i = 3; i * i == numv || i * i > numv; i++ )
71  ;
72  if( i * i != numv ) return false;
73  eset = eval_set();
74  return true;
75  }

References eval_set(), and MBQUAD.

◆ eval_set()

static EvalSet moab::SpectralQuad::eval_set ( )
inlinestatic

Definition at line 61 of file SpectralQuad.hpp.

62  {
64  }

References evalFcn(), initFcn(), integrateFcn(), jacobianFcn(), and reverseEvalFcn().

Referenced by compatible().

◆ evalFcn()

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.

84 {
85  // piece that we shouldn't want to cache
86  int d = 0;
87  for( d = 0; d < 2; d++ )
88  {
89  lagrange_0( &_ld[d], params[d] );
90  }
91  CartVect result;
92  for( d = 0; d < 3; d++ )
93  {
94  result[d] = tensor_i2( _ld[0].J, _ld[0].n, _ld[1].J, _ld[1].n, _xyz[d], _odwork );
95  }
96  return result;
97 }

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

Referenced by eval_set().

◆ initFcn()

static ErrorCode moab::SpectralQuad::initFcn ( const double *  verts,
const int  nverts,
double *&  work 
)
static

Initialize this EvalSet.

Referenced by eval_set().

◆ insideFcn()

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 166 of file SpectralQuad.cpp.

167 {
168  return EvalSet::inside( params, ndim, tol );
169 }

◆ integrateFcn()

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.

Referenced by eval_set().

◆ jacobianFcn()

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.

Referenced by eval_set().

◆ reverseEvalFcn()

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 99 of file SpectralQuad.cpp.

108 {
109  params = init;
110 
111  // find nearest point
112  double x_star[3];
113  xyz.get( x_star );
114 
115  double r[2] = { 0, 0 }; // initial guess for parametric coords
116  unsigned c = opt_no_constraints_3;
117  double dist = opt_findpt_2( &_data, (const double**)_xyz, x_star, r, &c );
118  // if it did not converge, get out with throw...
119  if( dist > 0.9e+30 )
120  {
121  std::vector< CartVect > dummy;
122  throw Map::EvaluationError( CartVect( x_star ), dummy );
123  }
124  // c tells us if we landed inside the element or exactly on a face, edge, or node
125  // also, dist shows the distance to the computed point.
126  // copy parametric coords back
127  params = r;
128 
129  return insideFcn( params, 2, inside_tol );
130 }

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

Referenced by eval_set().

Member Data Documentation

◆ _data

opt_data_2 moab::SpectralQuad::_data
staticprotected

Definition at line 81 of file SpectralQuad.hpp.

◆ _glpoints

real * moab::SpectralQuad::_glpoints
staticprotected

Definition at line 86 of file SpectralQuad.hpp.

◆ _init

bool moab::SpectralQuad::_init = false
staticprotected

Definition at line 85 of file SpectralQuad.hpp.

◆ _ld

lagrange_data moab::SpectralQuad::_ld
staticprotected

Definition at line 80 of file SpectralQuad.hpp.

◆ _n

int moab::SpectralQuad::_n
staticprotected

Definition at line 78 of file SpectralQuad.hpp.

◆ _odwork

real * moab::SpectralQuad::_odwork
staticprotected

Definition at line 82 of file SpectralQuad.hpp.

◆ _z

real * moab::SpectralQuad::_z
staticprotected

Definition at line 79 of file SpectralQuad.hpp.


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