MFEM  v4.5.1
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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. More...
 
void GetDiscreteTargetSpec (GridFunction &tspec_, int idx)
 Get one of the discrete fields from tspec. More...
 
FiniteElementSpaceGetTSpecFESpace ()
 Get the FESpace associated with tspec. More...
 
GridFunctionGetTSpecData ()
 Get the entire tspec. More...
 
void UpdateAfterMeshTopologyChange ()
 Update all discrete fields based on tspec and update for AMR. More...
 
ParFiniteElementSpaceGetTSpecParFESpace ()
 
void ParUpdateAfterMeshTopologyChange ()
 
void UpdateTargetSpecification (const Vector &new_x, bool use_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, double dx, bool use_flag=false, int x_ordering=Ordering::byNODES)
 
void UpdateHessianTargetSpecification (const Vector &x, double dx, bool use_flag=false, int x_ordering=Ordering::byNODES)
 
void SetAdaptivityEvaluator (AdaptivityEvaluator *ae)
 
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. More...
 
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. More...
 
virtual void ComputeElementTargetsGradient (const IntegrationRule &ir, const Vector &elfun, IsoparametricTransformation &Tpr, DenseTensor &dJtr) const
 
void SetTspecFromIntRule (int e_id, const IntegrationRule &intrule)
 
void SetMinSizeForTargets (double min_size_)
 
void SetTspecDataForDerefinement (FiniteElementSpace *fes)
 Computes target specification data with respect to the coarse FE space. More...
 
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. More...
 
 TargetConstructor (TargetType ttype, MPI_Comm mpicomm)
 Constructor for use in parallel. More...
 
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. More...
 
const GridFunctionGetNodes () const
 Get the nodes to be used in the target-matrix construction. More...
 
void SetVolumeScale (double vol_scale)
 Used by target type IDEAL_SHAPE_EQUAL_SIZE. The default volume scale is 1. More...
 
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'. More...
 
virtual bool ContainsVolumeInfo () const
 Checks if the target matrices contain non-trivial size specification. More...
 

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
 
double lim_min_size
 
bool good_tspec
 
bool good_tspec_grad
 
bool good_tspec_hess
 
AdaptivityEvaluatoradapt_eval
 
- Protected Attributes inherited from mfem::TargetConstructor
const GridFunctionnodes
 
double avg_volume
 
double 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 1347 of file tmop.hpp.

Constructor & Destructor Documentation

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

Definition at line 1405 of file tmop.hpp.

mfem::DiscreteAdaptTC::~DiscreteAdaptTC ( )
virtual

Definition at line 2613 of file tmop.cpp.

Member Function Documentation

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 126 of file tmop_pa_da3.cpp.

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 1949 of file tmop.cpp.

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

Reimplemented from mfem::TargetConstructor.

Definition at line 2164 of file tmop.cpp.

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

Definition at line 1633 of file tmop.cpp.

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

Definition at line 1812 of file tmop.cpp.

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

Get one of the discrete fields from tspec.

Definition at line 1833 of file tmop.cpp.

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

Get the entire tspec.

Definition at line 1455 of file tmop.hpp.

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

Get the FESpace associated with tspec.

Definition at line 1453 of file tmop.hpp.

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

Definition at line 1460 of file tmop.hpp.

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

Definition at line 1501 of file tmop.hpp.

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

Definition at line 1502 of file tmop.hpp.

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

Definition at line 1503 of file tmop.hpp.

void mfem::DiscreteAdaptTC::ParUpdateAfterMeshTopologyChange ( )

Definition at line 1658 of file tmop.cpp.

void mfem::DiscreteAdaptTC::ResetDerefinementTspecData ( )
inline

Definition at line 1545 of file tmop.hpp.

void mfem::DiscreteAdaptTC::ResetRefinementTspecData ( )
inline

Definition at line 1538 of file tmop.hpp.

void mfem::DiscreteAdaptTC::ResetUpdateFlags ( )
inline

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

Definition at line 1447 of file tmop.hpp.

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

Definition at line 1901 of file tmop.cpp.

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

Definition at line 1495 of file tmop.hpp.

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

Definition at line 1735 of file tmop.cpp.

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

Definition at line 1532 of file tmop.hpp.

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

Definition at line 1709 of file tmop.cpp.

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

Definition at line 1719 of file tmop.cpp.

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

Definition at line 1689 of file tmop.cpp.

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

Definition at line 1699 of file tmop.cpp.

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

Definition at line 1729 of file tmop.cpp.

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

Definition at line 1553 of file tmop.hpp.

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

Definition at line 1792 of file tmop.cpp.

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

Definition at line 1802 of file tmop.cpp.

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

Definition at line 1772 of file tmop.cpp.

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

Definition at line 1782 of file tmop.cpp.

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

Definition at line 1858 of file tmop.cpp.

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

Definition at line 1759 of file tmop.cpp.

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

Definition at line 1676 of file tmop.cpp.

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

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

Definition at line 1941 of file tmop.cpp.

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

Definition at line 1915 of file tmop.cpp.

void mfem::DiscreteAdaptTC::UpdateAfterMeshTopologyChange ( )

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

Definition at line 1847 of file tmop.cpp.

void mfem::DiscreteAdaptTC::UpdateGradientTargetSpecification ( const Vector x,
double  dx,
bool  use_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 use_flags is true, repeated calls won't do anything until ResetUpdateFlags() is called.

Definition at line 2511 of file tmop.cpp.

void mfem::DiscreteAdaptTC::UpdateHessianTargetSpecification ( const Vector x,
double  dx,
bool  use_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 use_flags is true, repeated calls won't do anything until ResetUpdateFlags() is called.

Definition at line 2546 of file tmop.cpp.

void mfem::DiscreteAdaptTC::UpdateTargetSpecification ( const Vector new_x,
bool  use_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 use_flags is true, repeated calls won't do anything until ResetUpdateFlags() is called.

Definition at line 1864 of file tmop.cpp.

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

Definition at line 1877 of file tmop.cpp.

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

Definition at line 1884 of file tmop.cpp.

Member Data Documentation

AdaptivityEvaluator* mfem::DiscreteAdaptTC::adapt_eval
protected

Definition at line 1394 of file tmop.hpp.

int mfem::DiscreteAdaptTC::amr_el
protected

Definition at line 1385 of file tmop.hpp.

int mfem::DiscreteAdaptTC::aspectratioidx
protected

Definition at line 1352 of file tmop.hpp.

FiniteElementSpace* mfem::DiscreteAdaptTC::coarse_tspec_fesv
protected

Definition at line 1376 of file tmop.hpp.

bool mfem::DiscreteAdaptTC::good_tspec
protected

Definition at line 1390 of file tmop.hpp.

bool mfem::DiscreteAdaptTC::good_tspec_grad
protected

Definition at line 1390 of file tmop.hpp.

bool mfem::DiscreteAdaptTC::good_tspec_hess
protected

Definition at line 1390 of file tmop.hpp.

DenseTensor mfem::DiscreteAdaptTC::Jtrcomp
mutableprotected

Definition at line 1371 of file tmop.hpp.

double mfem::DiscreteAdaptTC::lim_min_size
protected

Definition at line 1386 of file tmop.hpp.

int mfem::DiscreteAdaptTC::ncomp
protected

Definition at line 1352 of file tmop.hpp.

int mfem::DiscreteAdaptTC::orientationidx
protected

Definition at line 1352 of file tmop.hpp.

ParFiniteElementSpace* mfem::DiscreteAdaptTC::ptspec_fesv
protected

Definition at line 1380 of file tmop.hpp.

int mfem::DiscreteAdaptTC::sizeidx
protected

Definition at line 1352 of file tmop.hpp.

int mfem::DiscreteAdaptTC::skewidx
protected

Definition at line 1352 of file tmop.hpp.

Vector mfem::DiscreteAdaptTC::tspec
protected

Definition at line 1353 of file tmop.hpp.

Vector mfem::DiscreteAdaptTC::tspec_derefine
protected

Definition at line 1367 of file tmop.hpp.

FiniteElementSpace* mfem::DiscreteAdaptTC::tspec_fesv
protected

Definition at line 1375 of file tmop.hpp.

GridFunction* mfem::DiscreteAdaptTC::tspec_gf
protected

Definition at line 1377 of file tmop.hpp.

Vector mfem::DiscreteAdaptTC::tspec_pert1h
protected

Definition at line 1355 of file tmop.hpp.

Vector mfem::DiscreteAdaptTC::tspec_pert2h
protected

Definition at line 1356 of file tmop.hpp.

Vector mfem::DiscreteAdaptTC::tspec_pertmix
protected

Definition at line 1357 of file tmop.hpp.

ParGridFunction* mfem::DiscreteAdaptTC::tspec_pgf
protected

Definition at line 1382 of file tmop.hpp.

DenseMatrix mfem::DiscreteAdaptTC::tspec_refine
protected

Definition at line 1364 of file tmop.hpp.

Vector mfem::DiscreteAdaptTC::tspec_sav
protected

Definition at line 1354 of file tmop.hpp.


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