Go to the documentation of this file.
71 p_(simplex.pts()[simplex.tets()[0][3]]),
86 const scalar d =
mag(
n);
111 label iterI, outerIter(0);
116 scalar
func, lastFunc;
122 Info <<
"Tet " << nI <<
" has distance " << fx <<
" func "
126 Info <<
"Tolerance " << tol <<
endl;
140 Info <<
"Iteration " << iterI <<
endl;
141 Info <<
"Initial metric value " << lastFunc <<
endl;
151 const scalar determinant =
det(gradGradF);
152 if( determinant > SMALL )
154 disp = (
inv(gradGradF, determinant) & gradF);
158 const scalar& val = disp[i];
159 if( (val != val) || ((val - val) != (val - val)) )
171 Info <<
"Second grad " << gradGradF <<
endl;
172 Info <<
"inv(gradGradF, determinant) "
173 <<
inv(gradGradF, determinant) <<
endl;
174 Info <<
"Gradient " << gradF <<
endl;
175 Info <<
"Determinant " << determinant <<
endl;
176 Info <<
"Displacement " << disp <<
endl;
182 while(
func > lastFunc )
188 if(
func < lastFunc )
206 }
while( (
magSqr(disp) > tol) && (++iterI < 10) );
208 if( lastFunc < VSMALL )
210 }
while( !finished && (++outerIter < 5) );
213 Info <<
"Last value " << lastFunc <<
endl;
215 Info <<
"Metric with no beta " << evaluateMetricNoBeta() <<
endl;
219 Info <<
"Tet " << nI <<
" has distance " << fx <<
" func "
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
const point & max() const
Maximum describing the bounding box.
#define forAll(list, i)
Loop across all elements in list.
Template functions to aid in the implementation of demand driven data.
@ nComponents
Number of components in this vector space.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
DynList< point, 64 > centres_
centres of triangles forming the outer hull
Point centre() const
Return centre (centroid)
A triangle primitive used to calculate face normals and swept volumes.
scalar evaluateMetric() const
evaluate the value of the metric
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
class for volume optimizer
vector normal() const
Return vector normal.
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
DynList< point, 128 > & points_
mesh points
void func(FieldField< Field, Type > &f, const FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const point & min() const
Minimum describing the bounding box.
const DynList< partTet, 128 > & tets_
list tets around the given vertex
void evaluateGradients(vector &grad, tensor &gradGrad) const
evaluate metric gradients
DynList< vector, 64 > normals_
normals of triangles forming the outer hull
dimensionedSymmTensor sqr(const dimensionedVector &dv)
quadricMetric(partTetMeshSimplex &simplex)
bool contains(const point &) const
Contains point? (inside or on edge)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
label a() const
Return vertices.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void optimizeNodePosition(const scalar tol=0.001)