Public Member Functions | Private Member Functions | Static Private Attributes
volumeOptimizer Class Reference

class for volume optimizer More...

Inheritance diagram for volumeOptimizer:
Inheritance graph
[legend]
Collaboration diagram for volumeOptimizer:
Collaboration graph
[legend]

Public Member Functions

 volumeOptimizer (partTetMeshSimplex &simplex)
 construct from partTetMeshSimplex More...
 
 ~volumeOptimizer ()
 
void optimizeNodePosition (const scalar tol=0.001)
 find the best position for the node More...
 
- Public Member Functions inherited from simplexSmoother
 simplexSmoother (partTetMeshSimplex &simplex)
 construct from partTetMeshSimplex More...
 
virtual ~simplexSmoother ()
 

Private Member Functions

scalar evaluateFunc () const
 evaluate functional More...
 
scalar evaluateStabilisationFactor () const
 find appropriate value of K More...
 
void evaluateGradientsExact (vector &, tensor &) const
 evaluate gradients of the functional More...
 
scalar optimiseDivideAndConquer (const scalar tol)
 optimize position using a divide and conquer algorithm More...
 
scalar optimiseSteepestDescent (const scalar tol)
 optimise using the steepest descent More...
 

Static Private Attributes

static const vector dirVecs [8]
 direction vectors for divide and conquer algorithm More...
 

Additional Inherited Members

- Protected Attributes inherited from simplexSmoother
DynList< point, 128 > & points_
 mesh points More...
 
const DynList< partTet, 128 > & tets_
 list tets around the given vertex More...
 
const label pointI_
 label of the point More...
 
boundBox bb_
 bound box More...
 

Detailed Description

class for volume optimizer

Definition at line 53 of file volumeOptimizer.H.

Constructor & Destructor Documentation

◆ volumeOptimizer()

construct from partTetMeshSimplex

Definition at line 56 of file volumeOptimizer.C.

◆ ~volumeOptimizer()

Definition at line 61 of file volumeOptimizer.C.

Member Function Documentation

◆ evaluateFunc()

scalar evaluateFunc ( ) const
private

◆ evaluateStabilisationFactor()

scalar evaluateStabilisationFactor ( ) const
private

find appropriate value of K

Definition at line 75 of file volumeOptimizerEvaluateGradients.C.

References partTet::a(), tetrahedron::a(), partTet::b(), tetrahedron::b(), partTet::c(), tetrahedron::c(), partTet::d(), tetrahedron::d(), forAll, tetrahedron::mag(), Foam::magSqr(), Foam::max(), Foam::min(), simplexSmoother::points_, and simplexSmoother::tets_.

Referenced by volumeOptimizer::evaluateFunc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ evaluateGradientsExact()

void evaluateGradientsExact ( vector gradF,
tensor gradGradF 
) const
private

evaluate gradients of the functional

calculate the gradient of the volume

calculate the Frobenius norm

calculate the volume of the tetrahedron

calculate the stabilisation factor for the volume

evaluate the stabilised volume

calculate the gradient of the stabilisation volume

calculate the gradient of the Frobenius norm

calculate the gradient of the stabilised volume

calculate the gradient of the functional

calculate the second gradient of the stabilisation volume

calculate the second gradient of the stabilised volume

calculate the second gradient

Definition at line 113 of file volumeOptimizerEvaluateGradients.C.

References partTet::a(), tetrahedron::a(), partTet::b(), tetrahedron::b(), partTet::c(), tetrahedron::c(), partTet::d(), tetrahedron::d(), IOstream::defaultPrecision(), Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, forAll, Foam::Info, tetrahedron::mag(), Foam::magSqr(), p, Foam::pow(), Foam::sqr(), Foam::sqrt(), Foam::twoSymm(), Tensor::xx(), Tensor::yy(), Vector< scalar >::zero, Tensor::zero, and Tensor::zz().

Referenced by volumeOptimizer::optimiseSteepestDescent().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optimiseDivideAndConquer()

scalar optimiseDivideAndConquer ( const scalar  tol)
private

optimize position using a divide and conquer algorithm

find the value of the functional in the centre of the bnd box

set the centre with the minimum value as the centre for future search

halve the search range

calculate the tolerence

Definition at line 222 of file volumeOptimizerEvaluateGradients.C.

References simplexSmoother::bb_, volumeOptimizer::dirVecs, Foam::endl(), volumeOptimizer::evaluateFunc(), Foam::func(), Foam::Info, Foam::mag(), boundBox::max(), boundBox::min(), simplexSmoother::pointI_, simplexSmoother::points_, Vector< Cmpt >::x(), Vector< Cmpt >::y(), Vector< Cmpt >::z(), and Vector< scalar >::zero.

Referenced by volumeOptimizer::optimizeNodePosition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optimiseSteepestDescent()

scalar optimiseSteepestDescent ( const scalar  tol)
private

optimise using the steepest descent

it seems that this direction is wrong, stop the loop

move in random direction this is usually needed to move the point off the zero volume

Definition at line 286 of file volumeOptimizerEvaluateGradients.C.

References partTet::a(), partTet::b(), partTet::c(), Foam::det(), Foam::endl(), volumeOptimizer::evaluateFunc(), volumeOptimizer::evaluateGradientsExact(), forAll, Foam::Info, Foam::inv(), partTet::mag(), Foam::mag(), Foam::min(), n, Foam::nl, triangle::normal(), p, simplexSmoother::pointI_, simplexSmoother::points_, relax(), simplexSmoother::tets_, and Vector< scalar >::zero.

Referenced by volumeOptimizer::optimizeNodePosition().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optimizeNodePosition()

void optimizeNodePosition ( const scalar  tol = 0.001)
virtual

find the best position for the node

find the optimum using divide and conquer

check if the location can be improved using the steepest descent

scale back to the original size

Implements simplexSmoother.

Definition at line 67 of file volumeOptimizer.C.

References simplexSmoother::bb_, boundBox::contains(), forAll, Foam::func(), boundBox::mag(), boundBox::max(), boundBox::min(), volumeOptimizer::optimiseDivideAndConquer(), volumeOptimizer::optimiseSteepestDescent(), p, simplexSmoother::pointI_, and simplexSmoother::points_.

Referenced by boundaryLayerOptimisation::calculateNormalVectorsSmother(), tetMeshOptimisation::optimiseBoundaryVolumeOptimizer(), and tetMeshOptimisation::optimiseUsingVolumeOptimizer().

Here is the call graph for this function:
Here is the caller graph for this function:

Field Documentation

◆ dirVecs

const vector dirVecs
staticprivate
Initial value:
=
{
vector(-1.0, -1.0, -1.0),
vector(1.0, -1.0, -1.0),
vector(-1.0, 1.0, -1.0),
vector(1.0, 1.0, -1.0),
vector(-1.0, -1.0, 1.0),
vector(1.0, -1.0, 1.0),
vector(-1.0, 1.0, 1.0),
vector(1.0, 1.0, 1.0)
}

direction vectors for divide and conquer algorithm

Definition at line 59 of file volumeOptimizer.H.

Referenced by volumeOptimizer::optimiseDivideAndConquer().


The documentation for this class was generated from the following files:
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:49