MOAB: Mesh Oriented datABase  (version 5.4.1)

Shape function space for bilinear quadrilateral on sphere, obtained from the canonical linear (affine) functions. It is mapped using gnomonic projection to a plane tangent at the first vertex It works well for edges that are great circle arcs; RLL meshes do not have this property, but HOMME or MPAS meshes do have it. More...

#include <ElemUtil.hpp> Inheritance diagram for moab::Element::SphericalQuad: Collaboration diagram for moab::Element::SphericalQuad:

## Public Member Functions

SphericalQuad (const std::vector< CartVect > &vertices)
virtual bool inside_box (const CartVect &pos, double &tol) const
CartVect ievaluate (const CartVect &x, double tol=1e-6, const CartVect &x0=CartVect(0.0)) const
Evaluate the inverse map (calculate $$\vec \xi = F^-1(\vec x)$$ to given tolerance)

CartVect v1
Matrix3 transf

## Detailed Description

Shape function space for bilinear quadrilateral on sphere, obtained from the canonical linear (affine) functions. It is mapped using gnomonic projection to a plane tangent at the first vertex It works well for edges that are great circle arcs; RLL meshes do not have this property, but HOMME or MPAS meshes do have it.

Definition at line 312 of file ElemUtil.hpp.

## Constructor & Destructor Documentation

Definition at line 447 of file ElemUtil.cpp.

References moab::CartVect::length(), transf, and v1.

                                                                        : LinearQuad( vertices )
{
// project the vertices to the plane tangent at first vertex
v1          = vertex;  // member data
double v1v1 = v1 % v1;    // this is 1, in general, for unit sphere meshes
for( int j = 1; j < 4; j++ )
{
// first, bring all vertices in the gnomonic plane
//  the new vertex will intersect the plane at vnew
//   so that (vnew-v1)%v1 is 0 ( vnew is in the tangent plane, i.e. normal to v1 )
// pos is the old position of the vertex, and it is in general on the sphere
// vnew = alfa*pos;  (alfa*pos-v1)%v1 = 0  <=> alfa*(pos%v1)=v1%v1 <=> alfa =
// v1v1/(pos%v1)
//  <=> vnew = ( v1v1/(pos%v1) )*pos
CartVect vnew = v1v1 / ( vertex[j] % v1 ) * vertex[j];
vertex[j]     = vnew;
}
// will compute a transf matrix, such that a new point will be transformed with
// newpos =  transf * (vnew-v1), and it will be a point in the 2d plane
// the transformation matrix will be oriented in such a way that orientation will be
// positive
CartVect vx = vertex - v1;  // this will become Ox axis
// z axis will be along v1, in such a way that orientation of the quad is positive
// look at the first 2 edges
CartVect vz = vx * ( vertex - vertex );
vz          = vz / vz.length();

vx = vx / vx.length();

CartVect vy = vz * vx;
transf      = Matrix3( vx, vx, vx, vy, vy, vy, vz, vz, vz );
vertex   = CartVect( 0. );
for( int j = 1; j < 4; j++ )
vertex[j] = transf * ( vertex[j] - v1 );
}

 virtual moab::Element::SphericalQuad::~SphericalQuad ( )  [inline, virtual]

Definition at line 316 of file ElemUtil.hpp.

{};


## Member Function Documentation

 CartVect moab::Element::SphericalQuad::ievaluate ( const CartVect & x, double tol = 1e-6, const CartVect & x0 = CartVect( 0.0 ) ) const [virtual]

Evaluate the inverse map (calculate $$\vec \xi = F^-1(\vec x)$$ to given tolerance)

Reimplemented from moab::Element::Map.

Definition at line 483 of file ElemUtil.cpp.

References transf, and v1.

    {
// project to the plane tangent at first vertex (gnomonic projection)
double v1v1   = v1 % v1;
CartVect vnew = v1v1 / ( x % v1 ) * x;  // so that (vnew-v1)%v1 is 0
vnew          = transf * ( vnew - v1 );
// det will be positive now
return Map::ievaluate( vnew, tol, x0 );
}

 bool moab::Element::SphericalQuad::inside_box ( const CartVect & pos, double & tol ) const [virtual]

Reimplemented from moab::Element::Map.

Definition at line 493 of file ElemUtil.cpp.

References transf, and v1.

    {
// project to the plane tangent at first vertex
// CartVect v1=vertex;
double v1v1   = v1 % v1;
CartVect vnew = v1v1 / ( pos % v1 ) * pos;  // so that (x-v1)%v1 is 0
vnew          = transf * ( vnew - v1 );
return Map::inside_box( vnew, tol );
}


## Member Data Documentation

 Matrix3 moab::Element::SphericalQuad::transf [protected]

Definition at line 322 of file ElemUtil.hpp.

Referenced by ievaluate(), inside_box(), and SphericalQuad().

 CartVect moab::Element::SphericalQuad::v1 [protected]

Definition at line 321 of file ElemUtil.hpp.

Referenced by ievaluate(), inside_box(), and SphericalQuad().

List of all members.

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