ug4
|
Error estimator data class storing a number vector per side and per element. More...
#include <err_est_data.h>
Classes | |
struct | GetQuadRules |
helper struct for getting quadrature rules by use of mpl::lists More... | |
Public Types | |
typedef Attachment< std::vector< number > > | attachment_type |
attachment type More... | |
typedef TDomain | domain_type |
domain type More... | |
typedef domain_traits< dim >::element_type | elem_type |
typedef domain_traits< dim >::side_type | side_type |
type of the sides (face, edge) and the elems (volume, face) More... | |
typedef SideAndElemErrEstData< TDomain > | this_type |
this class More... | |
Public Member Functions | |
MathVector< TDomain::dim > * | all_side_global_ips (GridObject *elem, const MathVector< dim > vCornerCoords[]) |
get all global side integration points More... | |
virtual void | alloc_err_est_data (ConstSmartPtr< SurfaceView > spSV, const GridLevel &gl) |
virtual function to allocate data structures for the error estimator More... | |
MathVector< TDomain::dim > * | elem_global_ips (GridObject *elem, const MathVector< dim > vCornerCoords[]) |
get the global elem integration points for a specific roid More... | |
template<int refDim> | |
const MathVector< refDim > * | elem_local_ips (const ReferenceObjectID roid) |
get the local elem integration points for a specific roid More... | |
size_t | elem_order () const |
getting the elem integration order More... | |
size_t | first_side_ips (const ReferenceObjectID roid, const size_t side) |
get number of first IP belonging to a specific side More... | |
virtual number | get_elem_error_indicator (GridObject *elem, const MathVector< dim > vCornerCoords[]) |
calculate L2 integrals More... | |
size_t | num_all_side_ips (const ReferenceObjectID roid) |
get number of side IPs More... | |
size_t | num_elem_ips (const ReferenceObjectID roid) |
get number of elem IPs More... | |
size_t | num_side_ips (const ReferenceObjectID roid) |
get number of side IPs of a specific side type More... | |
size_t | num_side_ips (const side_type *pSide) |
get number of side IPs of a specific side More... | |
number & | operator() (elem_type *pElem, size_t ip) |
get the data reference for a given elem and ip More... | |
number & | operator() (side_type *pSide, size_t ip) |
get the data reference for a given side and ip More... | |
virtual void | release_err_est_data () |
virtual function to release data structures of the error estimator More... | |
void | set_type (int type) |
select L2/H1 Estimator More... | |
MathVector< TDomain::dim > * | side_global_ips (GridObject *elem, const MathVector< dim > vCornerCoords[]) |
get the global side integration points for a specific side roid More... | |
size_t | side_ip_index (const ReferenceObjectID roid, const size_t side, const size_t ip) |
get index of specific side IP in sideIP array returned by side_local_ips More... | |
template<int refDim> | |
const MathVector< refDim > * | side_local_ips (const ReferenceObjectID roid) |
get the local side integration points for a specific roid More... | |
size_t | side_order () const |
getting the side integration order More... | |
SideAndElemErrEstData (size_t _sideOrder, size_t _elemOrder, const char *subsets) | |
constructors More... | |
SideAndElemErrEstData (size_t _sideOrder, size_t _elemOrder, std::vector< std::string > subsets=std::vector< std::string >(0)) | |
virtual void | summarize_err_est_data (SmartPtr< TDomain > spDomain) |
virtual function called after the computation of the error estimator data in all the elements More... | |
ConstSmartPtr< SurfaceView > & | surface_view () |
get the surface view More... | |
virtual | ~SideAndElemErrEstData () |
virtual class destructor More... | |
Public Member Functions inherited from ug::IErrEstData< TDomain > | |
bool | consider_me () const |
virtual function granting get access to the m_consider member More... | |
IErrEstData () | |
class constructor More... | |
number | scaling_factor () |
get scaling factor More... | |
void | set_consider_me (bool b) |
whether or not this instance is to be considered by domainDisc More... | |
void | set_scaling_factor (number scale) |
set scaling factor for final error calculation More... | |
virtual | ~IErrEstData () |
virtual class destructor More... | |
Static Public Attributes | |
static const int | dim = TDomain::dim |
world dimension More... | |
static const int | MAX_NUM_SIDES = 8 |
maximal number of sides of any element More... | |
Static Public Attributes inherited from ug::IErrEstData< TDomain > | |
static const int | dim = TDomain::dim |
world dimension More... | |
Protected Member Functions | |
void | init_quadrature () |
initialization of quadrature (to be called during construction) More... | |
Private Types | |
enum | type { L2_ERROR_TYPE =0 , H1_ERROR_TYPE } |
set type More... | |
Private Attributes | |
size_t | elemOrder |
MultiGrid::AttachmentAccessor< elem_type, attachment_type > | m_aaElem |
vector of elem attachment accessors More... | |
MultiGrid::AttachmentAccessor< side_type, attachment_type > | m_aaSide |
vector of side attachment accessors More... | |
attachment_type | m_aElem |
vector of attachments for elems More... | |
attachment_type | m_aSide |
vector of attachments for sides More... | |
std::vector< MathVector< TDomain::dim > > | m_elemGlobalIPcoords |
GridLevel | m_errEstGL |
Finest grid level. More... | |
std::vector< MathVector< TDomain::dim > > | m_sideGlobalIPcoords |
storage for global elem and side IPs More... | |
std::vector< MathVector< TDomain::dim > > | m_SideIPcoords [NUM_REFERENCE_OBJECTS] |
extra storage for local side IPs (elem IPs are contained in elem quad rules) More... | |
size_t | m_sideIPsStartIndex [NUM_REFERENCE_OBJECTS][MAX_NUM_SIDES] |
the first index for IPs of a specific side in the sideIP series for a roid More... | |
std::vector< MathVector< TDomain::dim > > | m_singleSideGlobalIPcoords |
ConstSmartPtr< SurfaceView > | m_spSV |
Grid for the attachment. More... | |
SubsetGroup | m_ssg |
int | m_type |
std::vector< std::string > | m_vSs |
the subsets this error estimator will produce values for More... | |
QuadratureRule< dim > * | quadRuleElem [NUM_REFERENCE_OBJECTS] |
QuadratureRule< dim-1 > * | quadRuleSide [NUM_REFERENCE_OBJECTS] |
storage for integration rules More... | |
size_t | sideOrder |
order of side and elem function approximations for integrating More... | |
Error estimator data class storing a number vector per side and per element.
This class represents an H1 error estimator. It can integrate expressions on elements and their sides with arbitrary order. A vector of values at defined integration points is attached to any element and side to that end.
RECOMMENDED (INTENDED) USAGE The data will typically consist of the values of certain functions at integration points (IP) on the sides and the element. A pointer to an object of this class can be handed to any element discretization involved in a discretization. They will access the attachments in their method compute_err_est_elem and add their respective parts of the function to be integrated for the error estimator. Exactly one of them (or maybe some other object) then has to do the actual integration using the given values at the IPs and add up side and element terms according to the error estimator formula used.
TDomain | domain type |
typedef Attachment<std::vector<number> > ug::SideAndElemErrEstData< TDomain >::attachment_type |
attachment type
typedef TDomain ug::SideAndElemErrEstData< TDomain >::domain_type |
domain type
typedef domain_traits<dim>::element_type ug::SideAndElemErrEstData< TDomain >::elem_type |
typedef domain_traits<dim>::side_type ug::SideAndElemErrEstData< TDomain >::side_type |
type of the sides (face, edge) and the elems (volume, face)
typedef SideAndElemErrEstData<TDomain> ug::SideAndElemErrEstData< TDomain >::this_type |
this class
|
private |
ug::SideAndElemErrEstData< TDomain >::SideAndElemErrEstData | ( | size_t | _sideOrder, |
size_t | _elemOrder, | ||
const char * | subsets | ||
) |
ug::SideAndElemErrEstData< TDomain >::SideAndElemErrEstData | ( | size_t | _sideOrder, |
size_t | _elemOrder, | ||
std::vector< std::string > | subsets = std::vector<std::string>(0) |
||
) |
|
inlinevirtual |
virtual class destructor
MathVector< TDomain::dim > * ug::SideAndElemErrEstData< TDomain >::all_side_global_ips | ( | GridObject * | elem, |
const MathVector< dim > | vCornerCoords[] | ||
) |
get all global side integration points
References ug::DimReferenceMapping< TDim, TWorldDim >::local_to_global(), ug::GridObject::reference_object_id(), and UG_THROW.
Referenced by ug::NeumannBoundaryFV1< TDomain >::compute_err_est_rhs_elem(), and ug::NeumannBoundaryFV1< TDomain >::prep_err_est_elem().
|
virtual |
virtual function to allocate data structures for the error estimator
Allocates data structures for the error estimator.
Implements ug::IErrEstData< TDomain >.
References ug::GridLevel::SURFACE, ug::GridLevel::type(), and UG_COND_THROW.
MathVector< TDomain::dim > * ug::SideAndElemErrEstData< TDomain >::elem_global_ips | ( | GridObject * | elem, |
const MathVector< dim > | vCornerCoords[] | ||
) |
get the global elem integration points for a specific roid
References ug::DimReferenceMapping< TDim, TWorldDim >::local_to_global(), ug::GridObject::reference_object_id(), and UG_THROW.
const MathVector< refDim > * ug::SideAndElemErrEstData< TDomain >::elem_local_ips | ( | const ReferenceObjectID | roid | ) |
get the local elem integration points for a specific roid
References dim, and UG_COND_THROW.
|
inline |
getting the elem integration order
References ug::SideAndElemErrEstData< TDomain >::elemOrder.
size_t ug::SideAndElemErrEstData< TDomain >::first_side_ips | ( | const ReferenceObjectID | roid, |
const size_t | side | ||
) |
get number of first IP belonging to a specific side
Referenced by ug::NeumannBoundaryFV1< TDomain >::compute_err_est_rhs_elem().
|
virtual |
calculate L2 integrals
Implements ug::IErrEstData< TDomain >.
References ug::Grid::associated_elements(), dim, ug::ReferenceMappingProvider::get(), ug::ReferenceElement::id(), ug::ReferenceElement::num(), ug::GridObject::reference_object_id(), ug::DimReferenceMapping< TDim, TWorldDim >::sqrt_gram_det(), UG_COND_THROW, UG_THROW, and ug::DimReferenceMapping< TDim, TWorldDim >::update().
|
protected |
initialization of quadrature (to be called during construction)
References ug::DimReferenceElement< d >::corner(), dim, ug::ReferenceElement::dimension(), ug::ReferenceElementProvider::get(), ug::ReferenceMappingProvider::get(), ug::ReferenceElement::id(), ug::ReferenceElement::num(), ug::NUM_REFERENCE_OBJECTS, ug::ReferenceElement::roid(), ug::ROID_VERTEX, and UG_THROW.
Referenced by ug::SideAndElemErrEstData< TDomain >::SideAndElemErrEstData().
size_t ug::SideAndElemErrEstData< TDomain >::num_all_side_ips | ( | const ReferenceObjectID | roid | ) |
get number of side IPs
Referenced by ug::NeumannBoundaryFV1< TDomain >::prep_err_est_elem(), and ug::NeumannBoundaryFV1< TDomain >::prep_err_est_elem_loop().
size_t ug::SideAndElemErrEstData< TDomain >::num_elem_ips | ( | const ReferenceObjectID | roid | ) |
get number of elem IPs
References UG_COND_THROW.
size_t ug::SideAndElemErrEstData< TDomain >::num_side_ips | ( | const ReferenceObjectID | roid | ) |
get number of side IPs of a specific side type
References UG_COND_THROW.
size_t ug::SideAndElemErrEstData< TDomain >::num_side_ips | ( | const side_type * | pSide | ) |
get number of side IPs of a specific side
Referenced by ug::NeumannBoundaryFV1< TDomain >::compute_err_est_rhs_elem().
number & ug::SideAndElemErrEstData< TDomain >::operator() | ( | elem_type * | pElem, |
size_t | ip | ||
) |
get the data reference for a given elem and ip
pElem | pointer to the elem |
ip | integration point id on the elem |
References UG_CATCH_THROW, and UG_THROW.
number & ug::SideAndElemErrEstData< TDomain >::operator() | ( | side_type * | pSide, |
size_t | ip | ||
) |
get the data reference for a given side and ip
pSide | pointer to the side |
ip | integration point id on the side |
References UG_CATCH_THROW, and UG_THROW.
|
virtual |
virtual function to release data structures of the error estimator
Releases data structures of the error estimator.
Implements ug::IErrEstData< TDomain >.
|
inline |
select L2/H1 Estimator
References ug::SideAndElemErrEstData< TDomain >::H1_ERROR_TYPE, and ug::SideAndElemErrEstData< TDomain >::m_type.
MathVector< TDomain::dim > * ug::SideAndElemErrEstData< TDomain >::side_global_ips | ( | GridObject * | elem, |
const MathVector< dim > | vCornerCoords[] | ||
) |
get the global side integration points for a specific side roid
References dim, ug::ReferenceMappingProvider::get(), ug::GridObject::reference_object_id(), and UG_THROW.
size_t ug::SideAndElemErrEstData< TDomain >::side_ip_index | ( | const ReferenceObjectID | roid, |
const size_t | side, | ||
const size_t | ip | ||
) |
get index of specific side IP in sideIP array returned by side_local_ips
const MathVector< refDim > * ug::SideAndElemErrEstData< TDomain >::side_local_ips | ( | const ReferenceObjectID | roid | ) |
|
inline |
getting the side integration order
References ug::SideAndElemErrEstData< TDomain >::sideOrder.
|
virtual |
virtual function called after the computation of the error estimator data in all the elements
Called after the computation of the error estimator data in all the elements.
Because of the multigrid hierarchy, the sides at the rim of a multigrid level only have one of the two flux terms (cis or trans). In order to calculate a jump, we need to add up the resp. attachments on parent and child for that side.
Implements ug::IErrEstData< TDomain >.
References ug::CollectCornerCoordinates(), pcl::InterfaceCommunicator< TLayout >::communicate(), ug::Grid::distributed_grid_manager(), pcl::InterfaceCommunicator< TLayout >::exchange_data(), ug::ComPol_CopyAttachment< TLayout, TAttachment >::extract_on_constrained_elems_only(), ug::DistributedGridManager::grid_layout_map(), ug::INT_H_MASTER, ug::INT_H_SLAVE, ug::INT_V_MASTER, ug::INT_V_SLAVE, PCL_RO_SUM, ug::SurfaceView::SHADOW_RIM, UG_THROW, ug::VecLengthSq(), and ug::VecSubtract().
|
inline |
get the surface view
References ug::SideAndElemErrEstData< TDomain >::m_spSV.
Referenced by ug::NeumannBoundaryFV1< TDomain >::compute_err_est_rhs_elem().
|
static |
world dimension
|
private |
Referenced by ug::SideAndElemErrEstData< TDomain >::elem_order().
|
private |
vector of elem attachment accessors
|
private |
vector of side attachment accessors
|
private |
vector of attachments for elems
|
private |
vector of attachments for sides
|
private |
|
private |
Finest grid level.
|
private |
storage for global elem and side IPs
|
private |
extra storage for local side IPs (elem IPs are contained in elem quad rules)
|
private |
the first index for IPs of a specific side in the sideIP series for a roid
|
private |
|
private |
Grid for the attachment.
Referenced by ug::SideAndElemErrEstData< TDomain >::surface_view().
|
private |
|
private |
Referenced by ug::SideAndElemErrEstData< TDomain >::set_type().
|
private |
the subsets this error estimator will produce values for
Referenced by ug::SideAndElemErrEstData< TDomain >::SideAndElemErrEstData().
|
static |
maximal number of sides of any element
|
private |
|
private |
storage for integration rules
|
private |
order of side and elem function approximations for integrating
Referenced by ug::SideAndElemErrEstData< TDomain >::side_order().