Go to the documentation of this file.
79 gradGrad += gfx * gfx;
88 p_(simplex.pts()[simplex.tets()[0][3]]),
104 const scalar d =
mag(
n);
131 label iterI, outerIter(0);
136 scalar
func, lastFunc;
142 Info <<
"Tet " << nI <<
" has distance " << fx <<
" func "
146 Info <<
"Tolerance " << tol <<
endl;
160 Info <<
"Iteration " << iterI <<
endl;
161 Info <<
"Initial metric value " << lastFunc <<
endl;
171 const scalar determinant =
det(gradGradF);
172 if( determinant > SMALL )
174 disp = (
inv(gradGradF, determinant) & gradF);
178 const scalar& val = disp[i];
179 if( (val != val) || ((val - val) != (val - val)) )
191 Info <<
"Second grad " << gradGradF <<
endl;
192 Info <<
"inv(gradGradF, determinant) " <<
inv(gradGradF, determinant) <<
endl;
193 Info <<
"Gradient " << gradF <<
endl;
194 Info <<
"Determinant " << determinant <<
endl;
195 Info <<
"Displacement " << disp <<
endl;
202 while(
func > lastFunc )
208 if(
func < lastFunc )
226 }
while( (
magSqr(disp) > tol) && (++iterI < 10) );
234 }
while( !finished && (++outerIter < 5) );
237 Info <<
"Last value " << lastFunc <<
endl;
243 Info <<
"Tet " << nI <<
" has distance " << fx <<
" func "
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
scalar mag() const
The magnitude of the bounding box span.
tmp< GeometricField< typename outerProduct< vector, Type >::type, fvPatchField, volMesh >> grad(const GeometricField< Type, fvsPatchField, surfaceMesh > &ssf)
scalar evaluateMetric() const
evaluate the value of the metric
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 > &)
dimensionedScalar sign(const dimensionedScalar &ds)
scalar beta_
control parameter. It helps the point get inside the feasible region
knuppMetric(partTetMeshSimplex &simplex)
Point centre() const
Return centre (centroid)
A triangle primitive used to calculate face normals and swept volumes.
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
scalar evaluateMetricNoBeta() const
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.
DynList< vector, 64 > normals_
normals of triangles forming the outer hull
const DynList< partTet, 128 > & tets_
list tets around the given vertex
void optimizeNodePosition(const scalar tol=0.001)
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool contains(const point &) const
Contains point? (inside or on edge)
void evaluateGradients(vector &grad, tensor &gradGrad) const
evaluate metric gradients
dimensionedScalar det(const dimensionedSphericalTensor &dt)
label a() const
Return vertices.
DynList< point, 64 > centres_
centres of triangles forming the outer hull
dimensioned< scalar > magSqr(const dimensioned< Type > &)