![]() |
Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
00001 /*
00002 * MOAB, a Mesh-Oriented datABase, is a software component for creating,
00003 * storing and accessing finite element mesh data.
00004 *
00005 * Copyright 2004 Sandia Corporation. Under the terms of Contract
00006 * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
00007 * retains certain rights in this software.
00008 *
00009 * This library is free software; you can redistribute it and/or
00010 * modify it under the terms of the GNU Lesser General Public
00011 * License as published by the Free Software Foundation; either
00012 * version 2.1 of the License, or (at your option) any later version.
00013 *
00014 */
00015
00016 /**\class moab::EdgeSizeSimpleImplicit
00017 *
00018 * This is an simple example edge evaluator tha subdivides edges based
00019 * on their midpoint's distance to a simple, fixed-form implicit surface
00020 * written as \f$ x^T A x + B x + C \f$ where \f$x\f$ is a column vector of
00021 * holding the edge midpoint coordinates, \f$A\f$ is a symmetric 3x3 matrix,
00022 * \f$B\f$ is a 1x3 row vector, and \f$C\f$ is a scalar.
00023 * Whenever the implicit function divided by half of the edge length is smaller than
00024 * some minimum ratio (which defaults to 1), the edge is marked for subdivision.
00025 *
00026 * \author David Thompson
00027 *
00028 * \date 19 November 2007
00029 */
00030 #ifndef MOAB_EDGE_SIZE_SIMPLE_IMPLICIT_HPP
00031 #define MOAB_EDGE_SIZE_SIMPLE_IMPLICIT_HPP
00032
00033 #include "EdgeSizeEvaluator.hpp"
00034
00035 namespace moab
00036 {
00037
00038 class EdgeSizeSimpleImplicit : public EdgeSizeEvaluator
00039 {
00040 public:
00041 /// Construct an evaluator.
00042 EdgeSizeSimpleImplicit();
00043 /// Destruction is virtual so subclasses may clean up after refinement.
00044 virtual ~EdgeSizeSimpleImplicit();
00045
00046 /** \brief Given an edge of length L, true when edge midpoint is within $\alpha^2$ of
00047 * $\left(\frac{2f(x,y,z)}{L}\right)^2$.
00048 */
00049 virtual bool evaluate_edge( const double* p0,
00050 const void* t0,
00051 double* p1,
00052 void* t1,
00053 const double* p2,
00054 const void* t2 );
00055
00056 /// Set the 10 coefficients of the implicit function. The vector contains the entries of A,
00057 /// followed by B, followed by C.
00058 virtual void set_implicit_function( double* coeffs );
00059 /// Get the 10 coefficients of the implicit function. The vector contains the entries of A,
00060 /// followed by B, followed by C.
00061 void get_implicit_function( double*& coeffs );
00062
00063 /// Set the threshold ratio of function value to half-edge length that triggers subdivision.
00064 virtual void set_ratio( double r )
00065 {
00066 this->ratio = r;
00067 }
00068 /// Get the threshold ratio of function value to half-edge length that triggers subdivision.
00069 double get_ratio()
00070 {
00071 return this->ratio;
00072 }
00073
00074 protected:
00075 double coeffA[6];
00076 double coeffB[3];
00077 double coeffC;
00078 double ratio;
00079 };
00080
00081 } // namespace moab
00082
00083 #endif // MOAB_EDGE_SIZE_SIMPLE_IMPLICIT_HPP