Mesh Oriented datABase  (version 5.5.1)
An array-based unstructured mesh library
moab::SpectralHex Class Reference

#include <SpectralHex.hpp>

+ Collaboration diagram for moab::SpectralHex:

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 [3]
 
static lagrange_data _ld [3]
 
static opt_data_3 _data
 
static double * _odwork
 
static bool init_
 

Detailed Description

Definition at line 12 of file SpectralHex.hpp.

Member Function Documentation

◆ compatible()

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

Definition at line 66 of file SpectralHex.hpp.

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

References eval_set(), and MBHEX.

◆ eval_set()

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

Definition at line 61 of file SpectralHex.hpp.

62  {
64  }

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

Referenced by compatible().

◆ evalFcn()

static ErrorCode moab::SpectralHex::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.

Referenced by eval_set().

◆ initFcn()

void moab::SpectralHex::initFcn ( const double *  verts,
const int  nverts,
double *&  work 
)
static

Initialize this EvalSet.

Definition at line 18 of file SpectralHex.cpp.

19 {
20  if( _init && _n == order ) return;
21  if( _init && _n != order )
22  {
23  // TODO: free data cached
24  freedata();
25  }
26  // compute stuff that depends only on order
27  _init = true;
28  _n = order;
29  // triplicates! n is the same in all directions !!!
30  for( int d = 0; d < 3; d++ )
31  {
32  _z[d] = tmalloc( double, _n );
33  lobatto_nodes( _z[d], _n );
34  lagrange_setup( &_ld[d], _z[d], _n );
35  }
36  opt_alloc_3( &_data, _ld );
37 
38  unsigned int nf = _n * _n, ne = _n, nw = 2 * _n * _n + 3 * _n;
39  _odwork = tmalloc( double, 6 * nf + 9 * ne + nw );
40 }

References _data, _ld, _n, _odwork, _z, lagrange_setup(), lobatto_nodes(), opt_alloc_3(), and tmalloc.

Referenced by eval_set().

◆ insideFcn()

int moab::SpectralHex::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 183 of file SpectralHex.cpp.

184 {
185  return EvalSet::inside( params, ndim, tol );
186 }

◆ integrateFcn()

static ErrorCode moab::SpectralHex::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::SpectralHex::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()

static ErrorCode moab::SpectralHex::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.

Referenced by eval_set().

Member Data Documentation

◆ _data

opt_data_3 moab::SpectralHex::_data
staticprotected

◆ _ld

lagrange_data moab::SpectralHex::_ld
staticprotected

◆ _n

int moab::SpectralHex::_n
staticprotected

Definition at line 78 of file SpectralHex.hpp.

Referenced by initFcn().

◆ _odwork

real * moab::SpectralHex::_odwork
staticprotected

◆ _z

real * moab::SpectralHex::_z
staticprotected

Definition at line 79 of file SpectralHex.hpp.

Referenced by moab::Element::SpectralHex::freedata(), and initFcn().

◆ init_

bool moab::SpectralHex::init_
staticprotected

Definition at line 83 of file SpectralHex.hpp.


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