1 #ifndef __ERRORESTIMATOR_H 2 #define __ERRORESTIMATOR_H 14 #include <Eigen/Dense> 19 template<
typename ConfiguratorType>
28 typedef typename Eigen::Matrix<RealType, 3, 1>
VecType;
45 RealType refineAbove = errEstimates.lpNorm<Eigen::Infinity>() *
_gamma;
48 if (errEstimates[t] > refineAbove)
51 return errEstimates.norm();
61 for(
int i = 0; i < 4; i++) {
62 r = r || ( (x[1] > b) && (fabs(x[0]) + fabs(x[1]-b) < a) );
66 return 2.0 *
static_cast<RealType
>(r);
74 errEstimates[t] = sqrt(h) * J_t;
83 for (
int e = 0; e < 3; ++e) {
90 Jt += fabs(val - nVal);
100 for (
int i = 0; i < 3; ++i) {
RealType f(const typename ConfiguratorType::Point3DType &x) const
DataTypeContainer::Point3DType Point3DType
const TriangleType & getTriang(const int num) const
void refineMarkedTriangles()
Refines at least all triangles that have been marked.
ErrorEstimator(MeshType &grid, RealType gamma=0.4)
RealType jumpResidual(int t) const
void mark(int element)
Mark element for refinement.
Class for local error estimation.
int getNeighbour(const int elementID, const int acrossLocalEdge) const
Get neighbor on edge.
DataTypeContainer::RealType RealType
ConfiguratorType::InitType MeshType
RealType getMidpointValue(int t) const
int getNumTriangs() const
Eigen::VectorXd VectorType
RealType markAndRefineTriangles()
LocalIndex getLongestEdgeIndex(GlobalIndex triangle) const
Get longest edge index (starting search possibly with a preferred edge)
const Point3DType & getNode(int i) const
Access node i.
ConfiguratorType::RealType RealType
Eigen::Matrix< RealType, 3, 1 > VecType
Triangle which has a tangent space at each node.
const TangentVecType & getEdge(int i) const
Access edge i.
void computeLocalErrorEstimates(VectorType &errEstimates) const