MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::DiscreteAdaptTC Class Reference

#include <tmop.hpp>

Inheritance diagram for mfem::DiscreteAdaptTC:
[legend]
Collaboration diagram for mfem::DiscreteAdaptTC:
[legend]

Public Member Functions

 DiscreteAdaptTC (TargetType ttype)
 
virtual ~DiscreteAdaptTC ()
 
void ResetUpdateFlags ()
 Used in combination with the Update methods to avoid extra computations.
 
void GetDiscreteTargetSpec (GridFunction &tspec_, int idx)
 Get one of the discrete fields from tspec.
 
FiniteElementSpaceGetTSpecFESpace ()
 Get the FESpace associated with tspec.
 
GridFunctionGetTSpecData ()
 Get the entire tspec.
 
void UpdateAfterMeshTopologyChange ()
 Update all discrete fields based on tspec and update for AMR.
 
ParFiniteElementSpaceGetTSpecParFESpace ()
 
void ParUpdateAfterMeshTopologyChange ()
 
void UpdateTargetSpecification (const Vector &new_x, bool reuse_flag=false, int new_x_ordering=Ordering::byNODES)
 
void UpdateTargetSpecification (Vector &new_x, Vector &IntData, int new_x_ordering=Ordering::byNODES)
 
void UpdateTargetSpecificationAtNode (const FiniteElement &el, ElementTransformation &T, int nodenum, int idir, const Vector &IntData)
 
void RestoreTargetSpecificationAtNode (ElementTransformation &T, int nodenum)
 
void UpdateGradientTargetSpecification (const Vector &x, real_t dx, bool reuse_flag=false, int x_ordering=Ordering::byNODES)
 
void UpdateHessianTargetSpecification (const Vector &x, real_t dx, bool reuse_flag=false, int x_ordering=Ordering::byNODES)
 
void SetAdaptivityEvaluator (AdaptivityEvaluator *ae)
 
const AdaptivityEvaluatorGetAdaptivityEvaluator () const
 
const VectorGetTspecPert1H ()
 
const VectorGetTspecPert2H ()
 
const VectorGetTspecPertMixH ()
 
virtual void ComputeElementTargets (int e_id, const FiniteElement &fe, const IntegrationRule &ir, const Vector &elfun, DenseTensor &Jtr) const
 Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadrature point in the element. The physical positions of the element's nodes are given by elfun. Note that this function assumes that UpdateTargetSpecification() has been called with the position vector corresponding to elfun.
 
virtual void ComputeAllElementTargets (const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
 Computes reference-to-target transformation Jacobians for all quadrature points in all elements.
 
virtual void ComputeElementTargetsGradient (const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
 
void SetTspecFromIntRule (int e_id, const IntegrationRule &intrule)
 
void SetMinSizeForTargets (real_t min_size_)
 
void SetTspecDataForDerefinement (FiniteElementSpace *fes)
 Computes target specification data with respect to the coarse FE space.
 
void ResetRefinementTspecData ()
 
void ResetDerefinementTspecData ()
 
void SetRefinementSubElement (int amr_el_)
 
Target specification methods.

The following methods are used to specify geometric parameters of the targets when these parameters are given by discrete FE functions. Note that every GridFunction given to the Set methods must use a H1_FECollection of the same order. The number of components must correspond to the type of geometric parameter and dimension.

Parameters
[in]tspec_Input values of a geometric parameter. Note that the methods in this class support only functions that use H1_FECollection collection of the same order.
virtual void SetSerialDiscreteTargetSpec (const GridFunction &tspec_)
 
virtual void SetSerialDiscreteTargetSize (const GridFunction &tspec_)
 
virtual void SetSerialDiscreteTargetSkew (const GridFunction &tspec_)
 
virtual void SetSerialDiscreteTargetAspectRatio (const GridFunction &tspec_)
 
virtual void SetSerialDiscreteTargetOrientation (const GridFunction &tspec_)
 
virtual void SetParDiscreteTargetSpec (const ParGridFunction &tspec_)
 
virtual void SetParDiscreteTargetSize (const ParGridFunction &tspec_)
 
virtual void SetParDiscreteTargetSkew (const ParGridFunction &tspec_)
 
virtual void SetParDiscreteTargetAspectRatio (const ParGridFunction &tspec_)
 
virtual void SetParDiscreteTargetOrientation (const ParGridFunction &tspec_)
 
- Public Member Functions inherited from mfem::TargetConstructor
 TargetConstructor (TargetType ttype)
 Constructor for use in serial.
 
 TargetConstructor (TargetType ttype, MPI_Comm mpicomm)
 Constructor for use in parallel.
 
virtual ~TargetConstructor ()
 
bool Parallel () const
 
MPI_Comm GetComm () const
 
bool Parallel () const
 
void SetNodes (const GridFunction &n)
 Set the nodes to be used in the target-matrix construction.
 
const GridFunctionGetNodes () const
 Get the nodes to be used in the target-matrix construction.
 
void SetVolumeScale (real_t vol_scale)
 Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1.
 
TargetType GetTargetType () const
 
bool UsesPhysicalCoordinates () const
 Return true if the methods ComputeElementTargets(), ComputeAllElementTargets(), and ComputeElementTargetsGradient() use the physical node coordinates provided by the parameters 'elfun', or 'xe'.
 
virtual bool ContainsVolumeInfo () const
 Checks if the target matrices contain non-trivial size specification.
 

Protected Member Functions

void SetDiscreteTargetBase (const GridFunction &tspec_)
 
void SetTspecAtIndex (int idx, const GridFunction &tspec_)
 
void FinalizeSerialDiscreteTargetSpec (const GridFunction &tspec_)
 
void SetTspecAtIndex (int idx, const ParGridFunction &tspec_)
 
void FinalizeParDiscreteTargetSpec (const ParGridFunction &tspec_)
 
- Protected Member Functions inherited from mfem::TargetConstructor
void ComputeAvgVolume () const
 
template<int DIM>
bool ComputeAllElementTargets (const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
 
void ComputeAllElementTargets_Fallback (const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &xe, DenseTensor &Jtr) const
 
template<>
bool ComputeAllElementTargets (const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &, DenseTensor &Jtr) const
 
template<>
bool ComputeAllElementTargets (const FiniteElementSpace &fes, const IntegrationRule &ir, const Vector &, DenseTensor &Jtr) const
 

Protected Attributes

int ncomp
 
int sizeidx
 
int skewidx
 
int aspectratioidx
 
int orientationidx
 
Vector tspec
 
Vector tspec_sav
 
Vector tspec_pert1h
 
Vector tspec_pert2h
 
Vector tspec_pertmix
 
DenseMatrix tspec_refine
 
Vector tspec_derefine
 
DenseTensor Jtrcomp
 
FiniteElementSpacetspec_fesv
 
FiniteElementSpacecoarse_tspec_fesv
 
GridFunctiontspec_gf
 
ParFiniteElementSpaceptspec_fesv
 
ParGridFunctiontspec_pgf
 
int amr_el
 
real_t lim_min_size
 
bool good_tspec
 
bool good_tspec_grad
 
bool good_tspec_hess
 
AdaptivityEvaluatoradapt_eval
 
- Protected Attributes inherited from mfem::TargetConstructor
const GridFunctionnodes
 
real_t avg_volume
 
real_t volume_scale
 
const TargetType target_type
 
bool uses_phys_coords
 
MPI_Comm comm
 

Additional Inherited Members

- Public Types inherited from mfem::TargetConstructor
enum  TargetType {
  IDEAL_SHAPE_UNIT_SIZE , IDEAL_SHAPE_EQUAL_SIZE , IDEAL_SHAPE_GIVEN_SIZE , GIVEN_SHAPE_AND_SIZE ,
  GIVEN_FULL
}
 Target-matrix construction algorithms supported by this class. More...
 

Detailed Description

Definition at line 1514 of file tmop.hpp.

Constructor & Destructor Documentation

◆ DiscreteAdaptTC()

mfem::DiscreteAdaptTC::DiscreteAdaptTC ( TargetType ttype)
inline

Definition at line 1572 of file tmop.hpp.

◆ ~DiscreteAdaptTC()

mfem::DiscreteAdaptTC::~DiscreteAdaptTC ( )
virtual

Definition at line 2803 of file tmop.cpp.

Member Function Documentation

◆ ComputeAllElementTargets()

void mfem::DiscreteAdaptTC::ComputeAllElementTargets ( const FiniteElementSpace & fes,
const IntegrationRule & ir,
const Vector & xe,
DenseTensor & Jtr ) const
virtual

Computes reference-to-target transformation Jacobians for all quadrature points in all elements.

Parameters
[in]fesThe nodal FE space
[in]irThe quadrature rule to use for all elements
[in]xeE-vector with the current physical coordinates/positions; this parameter is used only when needed by the target constructor, see UsesPhysicalCoordinates()
[out]JtrThe computed ref->target Jacobian matrices.

Reimplemented from mfem::TargetConstructor.

Definition at line 130 of file tmop_pa_da3.cpp.

◆ ComputeElementTargets()

void mfem::DiscreteAdaptTC::ComputeElementTargets ( int e_id,
const FiniteElement & fe,
const IntegrationRule & ir,
const Vector & elfun,
DenseTensor & Jtr ) const
virtual

Given an element and quadrature rule, computes ref->target transformation Jacobians for each quadrature point in the element. The physical positions of the element's nodes are given by elfun. Note that this function assumes that UpdateTargetSpecification() has been called with the position vector corresponding to elfun.

Reimplemented from mfem::TargetConstructor.

Definition at line 2139 of file tmop.cpp.

◆ ComputeElementTargetsGradient()

void mfem::DiscreteAdaptTC::ComputeElementTargetsGradient ( const IntegrationRule & ir,
const Vector & elfun,
IsoparametricTransformation & Tpr,
DenseTensor & dJtr ) const
virtual

Reimplemented from mfem::TargetConstructor.

Definition at line 2354 of file tmop.cpp.

◆ FinalizeParDiscreteTargetSpec()

void mfem::DiscreteAdaptTC::FinalizeParDiscreteTargetSpec ( const ParGridFunction & tspec_)
protected

Definition at line 1823 of file tmop.cpp.

◆ FinalizeSerialDiscreteTargetSpec()

void mfem::DiscreteAdaptTC::FinalizeSerialDiscreteTargetSpec ( const GridFunction & tspec_)
protected

Definition at line 2002 of file tmop.cpp.

◆ GetAdaptivityEvaluator()

const AdaptivityEvaluator * mfem::DiscreteAdaptTC::GetAdaptivityEvaluator ( ) const
inline

Definition at line 1668 of file tmop.hpp.

◆ GetDiscreteTargetSpec()

void mfem::DiscreteAdaptTC::GetDiscreteTargetSpec ( GridFunction & tspec_,
int idx )

Get one of the discrete fields from tspec.

Definition at line 2023 of file tmop.cpp.

◆ GetTSpecData()

GridFunction * mfem::DiscreteAdaptTC::GetTSpecData ( )
inline

Get the entire tspec.

Definition at line 1622 of file tmop.hpp.

◆ GetTSpecFESpace()

FiniteElementSpace * mfem::DiscreteAdaptTC::GetTSpecFESpace ( )
inline

Get the FESpace associated with tspec.

Definition at line 1620 of file tmop.hpp.

◆ GetTSpecParFESpace()

ParFiniteElementSpace * mfem::DiscreteAdaptTC::GetTSpecParFESpace ( )
inline

Definition at line 1627 of file tmop.hpp.

◆ GetTspecPert1H()

const Vector & mfem::DiscreteAdaptTC::GetTspecPert1H ( )
inline

Definition at line 1673 of file tmop.hpp.

◆ GetTspecPert2H()

const Vector & mfem::DiscreteAdaptTC::GetTspecPert2H ( )
inline

Definition at line 1674 of file tmop.hpp.

◆ GetTspecPertMixH()

const Vector & mfem::DiscreteAdaptTC::GetTspecPertMixH ( )
inline

Definition at line 1675 of file tmop.hpp.

◆ ParUpdateAfterMeshTopologyChange()

void mfem::DiscreteAdaptTC::ParUpdateAfterMeshTopologyChange ( )

Definition at line 1848 of file tmop.cpp.

◆ ResetDerefinementTspecData()

void mfem::DiscreteAdaptTC::ResetDerefinementTspecData ( )
inline

Definition at line 1717 of file tmop.hpp.

◆ ResetRefinementTspecData()

void mfem::DiscreteAdaptTC::ResetRefinementTspecData ( )
inline

Definition at line 1710 of file tmop.hpp.

◆ ResetUpdateFlags()

void mfem::DiscreteAdaptTC::ResetUpdateFlags ( )
inline

Used in combination with the Update methods to avoid extra computations.

Definition at line 1614 of file tmop.hpp.

◆ RestoreTargetSpecificationAtNode()

void mfem::DiscreteAdaptTC::RestoreTargetSpecificationAtNode ( ElementTransformation & T,
int nodenum )

Definition at line 2091 of file tmop.cpp.

◆ SetAdaptivityEvaluator()

void mfem::DiscreteAdaptTC::SetAdaptivityEvaluator ( AdaptivityEvaluator * ae)
inline

Definition at line 1662 of file tmop.hpp.

◆ SetDiscreteTargetBase()

void mfem::DiscreteAdaptTC::SetDiscreteTargetBase ( const GridFunction & tspec_)
protected

Definition at line 1925 of file tmop.cpp.

◆ SetMinSizeForTargets()

void mfem::DiscreteAdaptTC::SetMinSizeForTargets ( real_t min_size_)
inline

Definition at line 1704 of file tmop.hpp.

◆ SetParDiscreteTargetAspectRatio()

void mfem::DiscreteAdaptTC::SetParDiscreteTargetAspectRatio ( const ParGridFunction & tspec_)
virtual

Definition at line 1899 of file tmop.cpp.

◆ SetParDiscreteTargetOrientation()

void mfem::DiscreteAdaptTC::SetParDiscreteTargetOrientation ( const ParGridFunction & tspec_)
virtual

Definition at line 1909 of file tmop.cpp.

◆ SetParDiscreteTargetSize()

void mfem::DiscreteAdaptTC::SetParDiscreteTargetSize ( const ParGridFunction & tspec_)
virtual

Definition at line 1879 of file tmop.cpp.

◆ SetParDiscreteTargetSkew()

void mfem::DiscreteAdaptTC::SetParDiscreteTargetSkew ( const ParGridFunction & tspec_)
virtual

Definition at line 1889 of file tmop.cpp.

◆ SetParDiscreteTargetSpec()

void mfem::DiscreteAdaptTC::SetParDiscreteTargetSpec ( const ParGridFunction & tspec_)
virtual

Definition at line 1919 of file tmop.cpp.

◆ SetRefinementSubElement()

void mfem::DiscreteAdaptTC::SetRefinementSubElement ( int amr_el_)
inline

Definition at line 1725 of file tmop.hpp.

◆ SetSerialDiscreteTargetAspectRatio()

void mfem::DiscreteAdaptTC::SetSerialDiscreteTargetAspectRatio ( const GridFunction & tspec_)
virtual

Definition at line 1982 of file tmop.cpp.

◆ SetSerialDiscreteTargetOrientation()

void mfem::DiscreteAdaptTC::SetSerialDiscreteTargetOrientation ( const GridFunction & tspec_)
virtual

Definition at line 1992 of file tmop.cpp.

◆ SetSerialDiscreteTargetSize()

void mfem::DiscreteAdaptTC::SetSerialDiscreteTargetSize ( const GridFunction & tspec_)
virtual

Definition at line 1962 of file tmop.cpp.

◆ SetSerialDiscreteTargetSkew()

void mfem::DiscreteAdaptTC::SetSerialDiscreteTargetSkew ( const GridFunction & tspec_)
virtual

Definition at line 1972 of file tmop.cpp.

◆ SetSerialDiscreteTargetSpec()

void mfem::DiscreteAdaptTC::SetSerialDiscreteTargetSpec ( const GridFunction & tspec_)
virtual

Definition at line 2048 of file tmop.cpp.

◆ SetTspecAtIndex() [1/2]

void mfem::DiscreteAdaptTC::SetTspecAtIndex ( int idx,
const GridFunction & tspec_ )
protected

Definition at line 1949 of file tmop.cpp.

◆ SetTspecAtIndex() [2/2]

void mfem::DiscreteAdaptTC::SetTspecAtIndex ( int idx,
const ParGridFunction & tspec_ )
protected

Definition at line 1866 of file tmop.cpp.

◆ SetTspecDataForDerefinement()

void mfem::DiscreteAdaptTC::SetTspecDataForDerefinement ( FiniteElementSpace * fes)

Computes target specification data with respect to the coarse FE space.

Definition at line 2131 of file tmop.cpp.

◆ SetTspecFromIntRule()

void mfem::DiscreteAdaptTC::SetTspecFromIntRule ( int e_id,
const IntegrationRule & intrule )

Definition at line 2105 of file tmop.cpp.

◆ UpdateAfterMeshTopologyChange()

void mfem::DiscreteAdaptTC::UpdateAfterMeshTopologyChange ( )

Update all discrete fields based on tspec and update for AMR.

Definition at line 2037 of file tmop.cpp.

◆ UpdateGradientTargetSpecification()

void mfem::DiscreteAdaptTC::UpdateGradientTargetSpecification ( const Vector & x,
real_t dx,
bool reuse_flag = false,
int x_ordering = Ordering::byNODES )

Used for finite-difference based computations. Computes the target specifications after a mesh perturbation in x or y direction. If reuse_flag is true, repeated calls won't do anything until ResetUpdateFlags() is called.

Definition at line 2701 of file tmop.cpp.

◆ UpdateHessianTargetSpecification()

void mfem::DiscreteAdaptTC::UpdateHessianTargetSpecification ( const Vector & x,
real_t dx,
bool reuse_flag = false,
int x_ordering = Ordering::byNODES )

Used for finite-difference based computations. Computes the target specifications after two mesh perturbations in x and/or y direction. If reuse_flag is true, repeated calls won't do anything until ResetUpdateFlags() is called.

Definition at line 2736 of file tmop.cpp.

◆ UpdateTargetSpecification() [1/2]

void mfem::DiscreteAdaptTC::UpdateTargetSpecification ( const Vector & new_x,
bool reuse_flag = false,
int new_x_ordering = Ordering::byNODES )

Used to update the target specification after the mesh has changed. The new mesh positions are given by new_x. If reuse_flag is true, repeated calls won't do anything until ResetUpdateFlags() is called.

Definition at line 2054 of file tmop.cpp.

◆ UpdateTargetSpecification() [2/2]

void mfem::DiscreteAdaptTC::UpdateTargetSpecification ( Vector & new_x,
Vector & IntData,
int new_x_ordering = Ordering::byNODES )

Definition at line 2067 of file tmop.cpp.

◆ UpdateTargetSpecificationAtNode()

void mfem::DiscreteAdaptTC::UpdateTargetSpecificationAtNode ( const FiniteElement & el,
ElementTransformation & T,
int nodenum,
int idir,
const Vector & IntData )

Definition at line 2074 of file tmop.cpp.

Member Data Documentation

◆ adapt_eval

AdaptivityEvaluator* mfem::DiscreteAdaptTC::adapt_eval
protected

Definition at line 1561 of file tmop.hpp.

◆ amr_el

int mfem::DiscreteAdaptTC::amr_el
protected

Definition at line 1552 of file tmop.hpp.

◆ aspectratioidx

int mfem::DiscreteAdaptTC::aspectratioidx
protected

Definition at line 1519 of file tmop.hpp.

◆ coarse_tspec_fesv

FiniteElementSpace* mfem::DiscreteAdaptTC::coarse_tspec_fesv
protected

Definition at line 1543 of file tmop.hpp.

◆ good_tspec

bool mfem::DiscreteAdaptTC::good_tspec
protected

Definition at line 1557 of file tmop.hpp.

◆ good_tspec_grad

bool mfem::DiscreteAdaptTC::good_tspec_grad
protected

Definition at line 1557 of file tmop.hpp.

◆ good_tspec_hess

bool mfem::DiscreteAdaptTC::good_tspec_hess
protected

Definition at line 1557 of file tmop.hpp.

◆ Jtrcomp

DenseTensor mfem::DiscreteAdaptTC::Jtrcomp
mutableprotected

Definition at line 1538 of file tmop.hpp.

◆ lim_min_size

real_t mfem::DiscreteAdaptTC::lim_min_size
protected

Definition at line 1553 of file tmop.hpp.

◆ ncomp

int mfem::DiscreteAdaptTC::ncomp
protected

Definition at line 1519 of file tmop.hpp.

◆ orientationidx

int mfem::DiscreteAdaptTC::orientationidx
protected

Definition at line 1519 of file tmop.hpp.

◆ ptspec_fesv

ParFiniteElementSpace* mfem::DiscreteAdaptTC::ptspec_fesv
protected

Definition at line 1547 of file tmop.hpp.

◆ sizeidx

int mfem::DiscreteAdaptTC::sizeidx
protected

Definition at line 1519 of file tmop.hpp.

◆ skewidx

int mfem::DiscreteAdaptTC::skewidx
protected

Definition at line 1519 of file tmop.hpp.

◆ tspec

Vector mfem::DiscreteAdaptTC::tspec
protected

Definition at line 1520 of file tmop.hpp.

◆ tspec_derefine

Vector mfem::DiscreteAdaptTC::tspec_derefine
protected

Definition at line 1534 of file tmop.hpp.

◆ tspec_fesv

FiniteElementSpace* mfem::DiscreteAdaptTC::tspec_fesv
protected

Definition at line 1542 of file tmop.hpp.

◆ tspec_gf

GridFunction* mfem::DiscreteAdaptTC::tspec_gf
protected

Definition at line 1544 of file tmop.hpp.

◆ tspec_pert1h

Vector mfem::DiscreteAdaptTC::tspec_pert1h
protected

Definition at line 1522 of file tmop.hpp.

◆ tspec_pert2h

Vector mfem::DiscreteAdaptTC::tspec_pert2h
protected

Definition at line 1523 of file tmop.hpp.

◆ tspec_pertmix

Vector mfem::DiscreteAdaptTC::tspec_pertmix
protected

Definition at line 1524 of file tmop.hpp.

◆ tspec_pgf

ParGridFunction* mfem::DiscreteAdaptTC::tspec_pgf
protected

Definition at line 1549 of file tmop.hpp.

◆ tspec_refine

DenseMatrix mfem::DiscreteAdaptTC::tspec_refine
protected

Definition at line 1531 of file tmop.hpp.

◆ tspec_sav

Vector mfem::DiscreteAdaptTC::tspec_sav
protected

Definition at line 1521 of file tmop.hpp.


The documentation for this class was generated from the following files: