Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <EdgeSizeSimpleImplicit.hpp>
Public Member Functions | |
EdgeSizeSimpleImplicit () | |
Construct an evaluator. | |
virtual | ~EdgeSizeSimpleImplicit () |
Destruction is virtual so subclasses may clean up after refinement. | |
virtual bool | evaluate_edge (const double *p0, const void *t0, double *p1, void *t1, const double *p2, const void *t2) |
Given an edge of length L, true when edge midpoint is within $^2$ of $({2f(x,y,z)}{L})^2$. | |
virtual void | set_implicit_function (double *coeffs) |
Set the 10 coefficients of the implicit function. The vector contains the entries of A, followed by B, followed by C. | |
void | get_implicit_function (double *&coeffs) |
Get the 10 coefficients of the implicit function. The vector contains the entries of A, followed by B, followed by C. | |
virtual void | set_ratio (double r) |
Set the threshold ratio of function value to half-edge length that triggers subdivision. | |
double | get_ratio () |
Get the threshold ratio of function value to half-edge length that triggers subdivision. | |
Protected Attributes | |
double | coeffA [6] |
double | coeffB [3] |
double | coeffC |
double | ratio |
This is an simple example edge evaluator tha subdivides edges based on their midpoint's distance to a simple, fixed-form implicit surface written as \( x^T A x + B x + C \) where \(x\) is a column vector of holding the edge midpoint coordinates, \(A\) is a symmetric 3x3 matrix, \(B\) is a 1x3 row vector, and \(C\) is a scalar. Whenever the implicit function divided by half of the edge length is smaller than some minimum ratio (which defaults to 1), the edge is marked for subdivision.
Definition at line 38 of file EdgeSizeSimpleImplicit.hpp.
Construct an evaluator.
Definition at line 6 of file EdgeSizeSimpleImplicit.cpp.
moab::EdgeSizeSimpleImplicit::~EdgeSizeSimpleImplicit | ( | ) | [virtual] |
Destruction is virtual so subclasses may clean up after refinement.
Definition at line 20 of file EdgeSizeSimpleImplicit.cpp.
{}
bool moab::EdgeSizeSimpleImplicit::evaluate_edge | ( | const double * | p0, |
const void * | t0, | ||
double * | p1, | ||
void * | t1, | ||
const double * | p2, | ||
const void * | t2 | ||
) | [virtual] |
Given an edge of length L, true when edge midpoint is within $^2$ of $({2f(x,y,z)}{L})^2$.
Implements moab::EdgeSizeEvaluator.
Definition at line 22 of file EdgeSizeSimpleImplicit.cpp.
References coeffA, coeffB, coeffC, and ratio.
{ (void)t0; (void)t1; (void)t2; double L2 = 0.; double delta; int i; for( i = 0; i < 3; ++i ) { delta = p2[i + 3] - p0[i + 3]; L2 += delta * delta; } // parametric coords in p1[{0,1,2}] double x = p1[3]; double y = p1[4]; double z = p1[5]; double F2 = this->coeffA[0] * x * x + 2. * this->coeffA[1] * x * y + 2. * this->coeffA[2] * x * z + this->coeffA[3] * y * y + 2. * this->coeffA[4] * y * z + this->coeffA[5] * z * z + this->coeffB[0] * x + this->coeffB[1] * y + this->coeffB[2] * z + this->coeffC; F2 = F2 * F2; // square it double r2 = this->ratio * this->ratio; if( 4. * F2 / L2 < r2 ) return true; // Midpoint is close to surface => split edge return false; // Don't split edge }
void moab::EdgeSizeSimpleImplicit::get_implicit_function | ( | double *& | coeffs | ) |
Get the 10 coefficients of the implicit function. The vector contains the entries of A, followed by B, followed by C.
Definition at line 67 of file EdgeSizeSimpleImplicit.cpp.
double moab::EdgeSizeSimpleImplicit::get_ratio | ( | ) | [inline] |
Get the threshold ratio of function value to half-edge length that triggers subdivision.
Definition at line 69 of file EdgeSizeSimpleImplicit.hpp.
References ratio.
{ return this->ratio; }
void moab::EdgeSizeSimpleImplicit::set_implicit_function | ( | double * | coeffs | ) | [virtual] |
Set the 10 coefficients of the implicit function. The vector contains the entries of A, followed by B, followed by C.
Definition at line 54 of file EdgeSizeSimpleImplicit.cpp.
virtual void moab::EdgeSizeSimpleImplicit::set_ratio | ( | double | r | ) | [inline, virtual] |
Set the threshold ratio of function value to half-edge length that triggers subdivision.
Definition at line 64 of file EdgeSizeSimpleImplicit.hpp.
References ratio.
Referenced by TestMeshRefiner().
{ this->ratio = r; }
double moab::EdgeSizeSimpleImplicit::coeffA[6] [protected] |
Definition at line 75 of file EdgeSizeSimpleImplicit.hpp.
Referenced by EdgeSizeSimpleImplicit(), evaluate_edge(), get_implicit_function(), and set_implicit_function().
double moab::EdgeSizeSimpleImplicit::coeffB[3] [protected] |
Definition at line 76 of file EdgeSizeSimpleImplicit.hpp.
Referenced by EdgeSizeSimpleImplicit(), evaluate_edge(), get_implicit_function(), and set_implicit_function().
double moab::EdgeSizeSimpleImplicit::coeffC [protected] |
Definition at line 77 of file EdgeSizeSimpleImplicit.hpp.
Referenced by EdgeSizeSimpleImplicit(), evaluate_edge(), get_implicit_function(), and set_implicit_function().
double moab::EdgeSizeSimpleImplicit::ratio [protected] |
Definition at line 78 of file EdgeSizeSimpleImplicit.hpp.
Referenced by EdgeSizeSimpleImplicit(), evaluate_edge(), get_ratio(), and set_ratio().