34 #ifndef __H__UG__LIB_DISC__FUNCTION_SPACE__ERROR_INDICATOR__
35 #define __H__UG__LIB_DISC__FUNCTION_SPACE__ERROR_INDICATOR__
58 template <
typename TFunction>
61 typename TFunction::element_type,
65 typedef typename TFunction::const_element_iterator const_iterator;
66 typedef typename TFunction::element_type element_type;
69 typename TFunction::domain_type::position_accessor_type& aaPos
70 = u.domain()->position_accessor();
74 std::vector<MathVector<dim> > vLocalGrad;
75 std::vector<MathVector<dim> > vGlobalGrad;
76 std::vector<MathVector<dim> > vCorner;
79 const_iterator iter = u.template begin<element_type>();
80 const_iterator iterEnd = u.template end<element_type>();
83 for(; iter != iterEnd; ++iter)
86 element_type* elem = *iter;
97 = ReferenceMappingProvider::get<dim, dim>(roid);
103 const size_t numSH = lsfs.
num_sh();
104 vLocalGrad.resize(numSH);
105 vGlobalGrad.resize(numSH);
108 lsfs.
grads(&vLocalGrad[0], localIP);
120 const number elemSize = ElementSize<dim>(roid, &vCorner[0]);
124 for(
size_t sh = 0 ; sh < numSH; ++sh)
127 MatVecMult(vGlobalGrad[sh], JTInv, vLocalGrad[sh]);
130 Vertex* vert = elem->vertex(sh);
133 std::vector<DoFIndex> ind;
134 u.inner_dof_indices(vert, fct, ind);
137 vGlobalGrad[sh] *=
DoFRef(u, ind[0]);
140 MidGrad += vGlobalGrad[sh];
148 template <
typename TFunction>
151 typename TFunction::element_type,
155 typedef typename TFunction::const_element_iterator const_iterator;
156 typedef typename TFunction::domain_type domain_type;
157 typedef typename domain_type::grid_type grid_type;
158 typedef typename TFunction::element_type element_type;
159 typedef typename element_type::side side_type;
161 typename grid_type::template traits<side_type>::secure_container sides;
164 typename TFunction::domain_type::position_accessor_type& aaPos
165 = u.domain()->position_accessor();
167 grid_type& grid = *u.domain()->grid();
171 std::vector<MathVector<dim> > vLocalGrad;
172 std::vector<MathVector<dim> > vGlobalGrad;
173 std::vector<MathVector<dim> > vCorner;
176 const_iterator iter = u.template begin<element_type>();
177 const_iterator iterEnd = u.template end<element_type>();
180 for(; iter != iterEnd; ++iter)
183 element_type* elem = *iter;
186 grid.associated_elements_sorted(sides, elem );
197 = ReferenceMappingProvider::get<dim, dim>(roid);
203 const size_t numSH = lsfs.
num_sh();
204 vLocalGrad.resize(numSH);
205 vGlobalGrad.resize(numSH);
208 lsfs.
grads(&vLocalGrad[0], localIP);
220 const number elemSize = ElementSize<dim>(roid, &vCorner[0]);
224 for(
size_t sh = 0 ; sh < numSH; ++sh)
227 MatVecMult(vGlobalGrad[sh], JTInv, vLocalGrad[sh]);
230 std::vector<DoFIndex> ind;
231 u.inner_dof_indices(sides[sh], fct, ind);
234 vGlobalGrad[sh] *=
DoFRef(u, ind[0]);
237 MidGrad += vGlobalGrad[sh];
245 template <
int dim>
struct face_type_traits
269 template <
typename TFunction>
272 typename TFunction::element_type,
276 typedef typename TFunction::const_element_iterator const_iterator;
277 typedef typename TFunction::domain_type domain_type;
278 typedef typename domain_type::grid_type grid_type;
279 typedef typename TFunction::element_type element_type;
280 typedef typename element_type::side side_type;
282 typename grid_type::template traits<side_type>::secure_container sides;
288 typename TFunction::domain_type::position_accessor_type& aaPos
289 = u.domain()->position_accessor();
291 grid_type& grid = *u.domain()->grid();
296 std::vector<MathVector<dim> > vCorner;
297 std::vector<MathVector<dim> > sideCorners;
298 std::vector<MathVector<dim> > vSideCoPos;
301 const_iterator iter = u.template begin<element_type>();
302 const_iterator iterEnd = u.template end<element_type>();
305 for(; iter != iterEnd; ++iter)
308 element_type* elem = *iter;
313 grid.associated_elements_sorted(sides, elem );
319 = ReferenceElementProvider::get<dim>(roid);
325 const number elemSize = ElementSize<dim>(roid, &vCorner[0]);
327 typename grid_type::template traits<element_type>::secure_container assoElements;
330 for (
size_t s=0;
s<sides.size();
s++){
331 grid.associated_elements(assoElements,sides[
s]);
334 size_t numOfAsso = assoElements.size();
335 for (
size_t i=0;i<numOfAsso;i++){
336 std::vector<DoFIndex> ind;
337 u.inner_dof_indices(assoElements[i], fct, ind);
338 faceValue+=
DoFRef(u, ind[0]);
340 faceValue/=(
number)numOfAsso;
342 size_t numSideCo = rRefElem.
num(
dim-1,
s,0);
344 for (
size_t i = 0; i < numSideCo; ++i)
345 vSideCoPos.push_back(vCorner[rRefElem.
id(
dim-1,
s, 0, i)]);
349 if ((
int)numSideCo==
dim)
350 ElementNormal<face_type0,dim>(normal,&vSideCoPos[0]);
352 ElementNormal<face_type1,dim>(normal,&vSideCoPos[0]);
354 for (
int d=0;d<
dim;d++){
355 vGlobalGrad[d] += faceValue * normal[d];
358 vGlobalGrad/=(
number)elemSize;
361 aaError[elem] =
VecTwoNorm(vGlobalGrad) * pow(elemSize, 2./
dim);
366 template <
typename TDomain,
typename TAlgebra>
377 typedef typename TFunction::domain_type::grid_type grid_type;
378 typedef typename TFunction::element_type element_type;
390 pMG->template attach_to<element_type>(aError);
405 MarkElements<element_type> (aaError, refiner, u.
dof_distribution(), TOL, refineFrac, coarseFrac, maxLevel);
408 pMG->template detach_from<element_type>(aError);
412 template <
typename TDomain,
typename TAlgebra>
424 typedef typename TFunction::domain_type::grid_type grid_type;
425 typedef typename TFunction::element_type element_type;
437 pMG->template attach_to<element_type>(aError);
452 MarkElementsAbsolute<element_type> (aaError, refiner, u.
dof_distribution (), refTol, coarsenTol, minLvl, maxLevel);
455 pMG->template detach_from<element_type>(aError);
459 template <
typename TFunction>
462 typename TFunction::element_type,
465 typename TFunction::element_type,
468 typedef typename TFunction::domain_type domain_type;
469 typedef typename domain_type::grid_type grid_type;
470 typedef typename TFunction::element_type element_type;
471 typedef typename element_type::side side_type;
472 typedef typename TFunction::template traits<side_type>::const_iterator side_iterator;
474 grid_type& grid = *u.domain()->grid();
477 side_iterator iter = u.template begin<side_type>();
478 side_iterator iterEnd = u.template end<side_type>();
480 for(; iter != iterEnd; ++iter)
483 side_type* side = *iter;
484 typename grid_type::template traits<element_type>::secure_container neighElements;
485 grid.associated_elements(neighElements,side);
486 if (neighElements.size()!=2)
continue;
487 number localJump = std::abs(aaGrad[neighElements[0]]-aaGrad[neighElements[1]]);
488 for (
size_t i=0;i<2;i++)
489 if (aaError[neighElements[i]]<localJump) aaError[neighElements[i]]=localJump;
496 template <
typename TDomain,
typename TAlgebra>
507 typedef typename TFunction::domain_type::grid_type grid_type;
508 typedef typename TFunction::element_type element_type;
520 pMG->template attach_to<element_type>(aGrad);
524 pMG->template attach_to<element_type>(aError);
540 MarkElements<element_type> (aaError, refiner, u.
dof_distribution(), TOL, refineFrac, coarseFrac, maxLevel);
543 pMG->template detach_from<element_type>(aError);
546 template <
typename TDomain,
typename TAlgebra>
558 typedef typename TFunction::domain_type::grid_type grid_type;
559 typedef typename TFunction::element_type element_type;
571 pMG->template attach_to<element_type>(aGrad);
575 pMG->template attach_to<element_type>(aError);
591 MarkElementsAbsolute<element_type> (aaError, refiner, u.
dof_distribution(), refTol, coarsenTol, minLvl, maxLevel);
594 pMG->template detach_from<element_type>(aError);
600 template <
typename TDomain,
typename TAlgebra>
608 int minLvl,
int maxLvl,
609 number time,
int quadOrder)
615 typedef typename TFunction::domain_type::grid_type grid_t;
616 typedef typename TFunction::element_type elem_t;
620 const size_t fct = u->fct_id_by_name(cmp);
622 "Function space does not contain a function with name " << cmp);
625 grid_t& mg = *u->domain()->grid();
627 typename TFunction::domain_type::position_accessor_type&
628 aaPos = u->domain()->position_accessor();
633 mg.template attach_to<elem_t>(aError);
641 Integrate<dim, dim>(u->template begin<elem_t>(), u->template end<elem_t>(),
642 aaPos, integrand, quadOrder,
"best", &aaError);
649 l2Error = sqrt(l2Error);
651 UG_LOG(
"maxError " << maxL2Error <<
", l2Error " << l2Error << std::endl);
653 if(l2Error > maxL2Error){
654 typedef typename TFunction::template traits<elem_t>::const_iterator ElemIter;
655 size_t numElemsActive = 0;
656 size_t numElemsTotal = 0;
658 number minElemError = numeric_limits<number>::max();
660 for(ElemIter iter = u->template begin<elem_t>(); iter != u->template end<elem_t>(); ++iter){
662 if(mg.get_level(*iter) < maxLvl){
664 maxElemError = max(maxElemError, aaError[*iter]);
665 minElemError = min(minElemError, aaError[*iter]);
668 fixedError += aaError[*iter];
680 maxElemError = minElemError + (maxElemError - minElemError) *
sq(refFrac);
681 number refThreshold = maxElemError;
699 mg.template detach_from<elem_t>(aError);
713 template <
class s
ide_t,
class TFunction>
717 typedef typename TFunction::domain_type::grid_type grid_t;
719 grid_t& g = *u.domain()->grid();
763 const SurfaceView* surfView = u.approx_space()->surface_view().get();
768 for(grid_side_iter_t iter = g.template begin<side_t>();
769 iter != g.template end<side_t>(); ++iter)
775 const size_t numChildren = g.template num_children<side_t>(
s);
778 for(
size_t i_child = 0; i_child < numChildren; ++i_child){
779 side_t* c = g.template get_child<side_t>(
s, i_child);
780 aaSideError[
s] += w * aaSideError[c];
781 aaNumElems[
s] += w * aaNumElems[c];
792 for(grid_side_iter_t iter = g.template begin<side_t>();
793 iter != g.template end<side_t>(); ++iter)
799 const size_t numChildren = g.template num_children<side_t>(
s);
802 for(
size_t i_child = 0; i_child < numChildren; ++i_child){
803 side_t* c = g.template get_child<side_t>(
s, i_child);
804 aaSideError[c] = w * aaSideError[
s];
805 aaNumElems[c] = w * aaNumElems[
s];
826 template <
typename TGradientEvaluator,
typename TFunction>
829 typename TFunction::element_type,
831 bool addErrSquareToAAError =
false)
836 typedef typename TFunction::domain_type::grid_type grid_t;
837 typedef typename TFunction::const_element_iterator const_iterator;
838 typedef typename TFunction::element_type elem_t;
839 typedef typename elem_t::side side_t;
843 typename TFunction::domain_type::position_accessor_type& aaPos
844 = u.domain()->position_accessor();
848 grid_t& g = *u.domain()->grid();
851 g.template attach_to_dv<side_t>(aSideError, 0);
852 g.template attach_to_dv<side_t>(aNumElems, 0);
857 TGradientEvaluator gradEvaluator(&u, fct);
858 const_iterator iterEnd = u.template end<elem_t>();
859 for(const_iterator iter = u.template begin<elem_t>();
860 iter != iterEnd; ++iter)
863 elem_t* elem = *iter;
864 vector_t elemGrad = gradEvaluator.evaluate(elem);
868 for(
size_t i = 0; i < elem->num_sides(); ++i){
871 side_t*
s = g.get_side(elem, i);
872 aaSideError[
s] += ng;
877 ExchangeAndAdjustSideErrors<side_t>(u, aSideError, aNumElems);
884 for(const_iterator iter = u.template begin<elem_t>();
885 iter != iterEnd; ++iter)
887 elem_t* elem = *iter;
889 g.associated_elements(sides, elem);
890 for(
size_t i = 0; i < sides.
size(); ++i){
891 side_t*
s = sides[i];
892 if(aaNumElems[
s] > 1){
893 g.associated_elements(edges,
s);
896 err += hs *
sq(a * aaSideError[
s]);
900 if(addErrSquareToAAError)
901 aaError[elem] += 0.5 * err;
903 aaError[elem] = sqrt(0.5 * err);
906 g.template detach_from<side_t>(aSideError);
907 g.template detach_from<side_t>(aNumElems);
913 template <
typename TGradientEvaluator,
typename TFunction>
916 typename TFunction::element_type,
922 typedef typename TFunction::domain_type::grid_type grid_t;
923 typedef typename TFunction::const_element_iterator const_iterator;
924 typedef typename TFunction::element_type elem_t;
925 typedef typename elem_t::side side_t;
929 typename TFunction::domain_type::position_accessor_type& aaPos
930 = u.domain()->position_accessor();
937 grid_t& g = *u.domain()->grid();
940 g.template attach_to_dv<side_t>(aSideError, 0);
941 g.template attach_to_dv<side_t>(aNumElems, 0);
946 TGradientEvaluator gradEvaluator(&u, fct);
947 const_iterator iterEnd = u.template end<elem_t>();
948 for(const_iterator iter = u.template begin<elem_t>();
949 iter != iterEnd; ++iter)
952 elem_t* elem = *iter;
953 vector_t elemGrad = gradEvaluator.evaluate(elem);
956 aaError[elem] = elemContrib;
957 g.associated_elements(sides, elem);
958 for(
size_t i = 0; i < sides.
size(); ++i){
959 side_t*
s = sides[i];
960 aaSideError[
s] += elemContrib;
965 ExchangeAndAdjustSideErrors<side_t>(u, aSideError, aNumElems);
969 for(const_iterator iter = u.template begin<elem_t>();
970 iter != iterEnd; ++iter)
972 elem_t* elem = *iter;
973 const number elemErr = aaError[elem];
975 g.associated_elements(sides, elem);
976 for(
size_t i = 0; i < sides.
size(); ++i){
977 side_t*
s = sides[i];
978 if(aaNumElems[
s] > 0)
979 err = max(err, fabs(elemErr - aaSideError[
s] / aaNumElems[
s]));
987 g.template detach_from<side_t>(aSideError);
988 g.template detach_from<side_t>(aNumElems);
1005 template <
typename TDomain,
typename TAlgebra>
1010 int minLvl,
int maxLvl,
1011 std::string jumpType)
1014 using namespace std;
1017 typedef typename TFunction::domain_type::grid_type grid_t;
1018 typedef typename TFunction::element_type elem_t;
1019 typedef typename TFunction::template traits<elem_t>::const_iterator ElemIter;
1024 "Function space does not contain a function with name " << cmp);
1027 grid_t& mg = *u->domain()->grid();
1032 mg.template attach_to<elem_t>(aError);
1037 if(jumpType == std::string(
"norm"))
1038 EvaluateGradientJump_Norm<LagrangeP1Evaluator>(*u, fct, aaError);
1039 else if(jumpType == std::string(
"sideInt"))
1040 EvaluateGradientJump_SideIntegral<LagrangeP1Evaluator>(*u, fct, aaError);
1042 UG_THROW(
"Unsupported jumpType in MarkForAdaption_GradientJump: "
1043 "Valid values are: norm, sideInt");
1048 number minElemError = numeric_limits<number>::max();
1049 for(ElemIter iter = u->template begin<elem_t>(); iter != u->template end<elem_t>(); ++iter){
1050 if(mg.get_level(*iter) < maxLvl){
1051 maxElemError = max(maxElemError, aaError[*iter]);
1052 minElemError = min(minElemError, aaError[*iter]);
1063 number refTol = minElemError + (maxElemError - minElemError) * refFrac;
1068 mg.template detach_from<elem_t>(aError);
1073 template <
typename TFunction>
1078 int quadOrder, std::string quadType,
1080 typename TFunction::element_type,
1083 using namespace std;
1085 typedef typename TFunction::domain_type::grid_type grid_t;
1086 typedef typename TFunction::element_type elem_t;
1087 typedef typename TFunction::template traits<elem_t>::const_iterator ElemIter;
1091 const size_t fct = u->fct_id_by_name(cmp);
1093 "Function space does not contain a function with name " << cmp);
1096 grid_t& mg = *u->domain()->grid();
1097 typename TFunction::domain_type::position_accessor_type&
1098 aaPos = u->domain()->position_accessor();
1104 Integrate<dim, dim>(u->template begin<elem_t>(), u->template end<elem_t>(),
1105 aaPos, integrand, quadOrder, quadType, &aaError);
1109 for(ElemIter iter = u->template begin<elem_t>();
1110 iter != u->template end<elem_t>(); ++iter)
1112 elem_t* elem = *iter;
1119 EvaluateGradientJump_SideIntegral<LagrangeP1Evaluator>(*u, fct, aaError,
true);
1122 for(ElemIter iter = u->template begin<elem_t>();
1123 iter != u->template end<elem_t>(); ++iter)
1125 aaError[*iter] = sqrt(aaError[*iter]);
1143 template <
typename TDomain,
typename TAlgebra>
1152 int quadOrder, std::string quadType,
1153 bool refTopLvlOnly =
false)
1156 using namespace std;
1159 typedef typename TFunction::domain_type::grid_type grid_t;
1160 typedef typename TFunction::element_type elem_t;
1161 typedef typename TFunction::template traits<elem_t>::const_iterator ElemIter;
1164 grid_t& mg = *u->
domain()->grid();
1167 mg.template attach_to<elem_t>(aError);
1175 0, maxLvl, refTopLvlOnly);
1180 for(ElemIter iter = u->template begin<elem_t>();
1181 iter != u->template end<elem_t>(); ++iter)
1184 errs[1] +=
sq(aaError[e]);
1186 errs[0] +=
sq(aaError[e]);
1199 frac = sqrt(gErrs[0] / gErrs[1]);
1202 mg.template detach_from<elem_t>(aError);
1219 template <
typename TDomain,
typename TAlgebra>
1226 int minLvl,
int maxLvl,
1227 int quadOrder, std::string quadType)
1230 using namespace std;
1233 typedef typename TFunction::domain_type::grid_type grid_t;
1234 typedef typename TFunction::element_type elem_t;
1235 typedef typename TFunction::template traits<elem_t>::const_iterator ElemIter;
1238 grid_t& mg = *u->
domain()->grid();
1241 mg.template attach_to<elem_t>(aError);
1249 number minElemError = numeric_limits<number>::max();
1250 for(ElemIter iter = u->template begin<elem_t>();
1251 iter != u->template end<elem_t>(); ++iter)
1253 if(mg.get_level(*iter) < maxLvl){
1254 number err = aaError[*iter] = sqrt(aaError[*iter]);
1255 maxElemError = max(maxElemError, err);
1256 minElemError = min(minElemError, err);
1266 number refTol = minElemError + (maxElemError - minElemError) * refFrac;
1271 mg.template detach_from<elem_t>(aError);
1275 template <
typename TDomain,
typename TAlgebra>
1280 int minLvl,
int maxLvl)
1283 using namespace std;
1287 typedef typename TFunction::domain_type::grid_type grid_t;
1288 typedef typename TFunction::element_type elem_t;
1289 typedef typename TFunction::template traits<elem_t>::const_iterator ElemIter;
1293 typename TFunction::domain_type::position_accessor_type& aaPos
1294 = u->domain()->position_accessor();
1297 const size_t fct = u->fct_id_by_name(cmp);
1299 "Function space does not contain a function with name " << cmp);
1302 grid_t& mg = *u->domain()->grid();
1307 mg.template attach_to<elem_t>(aError);
1313 mg.attach_to_vertices(aGrad);
1318 mg.template end<Vertex>(), zeroVec);
1322 mg.attach_to_vertices(aNumContribs);
1325 mg.template end<Vertex>(), 0);
1332 LagrangeP1Evaluator gradEvaluator(u.get(), fct);
1335 ElemIter iterElemEnd = u->template end<elem_t>();
1336 for(ElemIter iter = u->template begin<elem_t>();
1337 iter != iterElemEnd; ++iter)
1340 elem_t* elem = *iter;
1341 vector_t elemGrad = gradEvaluator.evaluate(elem);
1343 mg.associated_elements(vrts, elem);
1344 for(
size_t i = 0; i < vrts.
size(); ++i){
1346 aaGradVrt[v] += elemGrad;
1347 ++aaNumContribsVrt[v];
1387 const SurfaceView* surfView = u->approx_space()->surface_view().get();
1392 for(grid_side_iter_t iter = mg.template begin<Vertex>();
1393 iter != mg.template end<Vertex>(); ++iter)
1399 Vertex* c = mg.get_child_vertex(
s);
1401 aaGradVrt[
s] += aaGradVrt[c];
1402 aaNumContribsVrt[
s] += aaNumContribsVrt[c];
1413 for(grid_side_iter_t iter = mg.template begin<Vertex>();
1414 iter != mg.template end<Vertex>(); ++iter)
1420 Vertex* c = mg.get_child_vertex(
s);
1422 aaGradVrt[c] = aaGradVrt[
s];
1423 aaNumContribsVrt[c] = aaNumContribsVrt[
s];
1431 for(constr_vrt_iter iter = mg.template begin<ConstrainedVertex>();
1432 iter != mg.template end<ConstrainedVertex>(); ++iter)
1438 aaNumContribsVrt[v] = 0;
1439 mg.associated_elements(vrts,
p);
1441 for(
size_t i = 0; i < vrts.
size(); ++i){
1444 aaGradVrt[v] += aaGradVrt[vrts[i]];
1445 aaNumContribsVrt[v] += aaNumContribsVrt[vrts[i]];
1448 aaGradVrt[v] /= (
number)numConstr;
1449 aaNumContribsVrt[v] /= (
number)numConstr;
1467 for(ElemIter iter = u->template begin<elem_t>();
1468 iter != iterElemEnd; ++iter)
1471 elem_t* elem = *iter;
1472 vector_t elemGrad = gradEvaluator.evaluate(elem);
1474 vector_t vrtAvrgGrad;
1476 mg.associated_elements(vrts, elem);
1477 for(
size_t i = 0; i < vrts.
size(); ++i){
1479 vector_t vg = aaGradVrt[v];
1480 vg /= aaNumContribsVrt[v];
1491 number minElemError = numeric_limits<number>::max();
1492 for(ElemIter iter = u->template begin<elem_t>(); iter != u->template end<elem_t>(); ++iter){
1493 if(mg.get_level(*iter) < maxLvl){
1494 maxElemError = max(maxElemError, aaErrorElem[*iter]);
1495 minElemError = min(minElemError, aaErrorElem[*iter]);
1506 number refTol = minElemError + (maxElemError - minElemError) * refFrac;
1511 mg.detach_from_vertices(aNumContribs);
1512 mg.detach_from_vertices(aGrad);
1513 mg.template detach_from<elem_t>(aError);
Definition: smart_pointer.h:108
Performs communication between interfaces on different processes.
Definition: pcl_interface_communicator.h:68
bool communicate(int tag=749345)
sends and receives the collected data.
Definition: pcl_interface_communicator_impl.hpp:409
void exchange_data(const TLayoutMap &layoutMap, const typename TLayoutMap::Key &keyFrom, const typename TLayoutMap::Key &keyTo, ICommunicationPolicy< TLayout > &commPol)
internally calls send_data and receive_data with the specified layouts.
Definition: pcl_interface_communicator_impl.hpp:213
the standard multi-level-layout implementation
Definition: pcl_communication_structs.h:615
Definition: pcl_process_communicator.h:70
void allreduce(const void *sendBuf, void *recBuf, int count, DataType type, ReduceOperation op) const
performs MPI_Allreduce on the processes of the communicator.
Definition: pcl_process_communicator.cpp:318
Performs reduce operations on the specified attachment.
Definition: compol_attachment_reduce.h:274
copies values from a specified attachment to a stream and back.
Definition: compol_copy_attachment.h:54
A vertex appearing on edges or faces.
Definition: grid_objects_0d.h:110
GridObject * get_constraining_object()
Definition: grid_objects_0d.h:150
virtual base class for reference mappings
Definition: reference_mapping_provider.h:53
virtual number jacobian_transposed_inverse(MathMatrix< worldDim, dim > &JTInv, const MathVector< dim > &locPos) const =0
returns transposed of the inverse of the jacobian and returns sqrt of gram determinante
virtual void update(const MathVector< worldDim > *vCornerCoord)=0
refresh mapping for new set of corners
manages the layouts and interfaces which are associated with a distributed grid.
Definition: distributed_grid.h:88
GridLayoutMap & grid_layout_map()
Definition: distributed_grid.h:103
size_t fct_id_by_name(const char *name) const
returns fct id by name
Definition: dof_distribution_info.h:188
const LFEID & local_finite_element_id(size_t fct) const
Definition: dof_distribution_info.h:225
bool partially_contains(TStorageType flag) const
Definition: flags.h:72
Definition: gradient_evaluators.h:48
the generic attachment-accessor for access to grids attachment pipes.
Definition: grid.h:182
represents numerical solutions on a grid using an algebraic vector
Definition: grid_function.h:121
SmartPtr< TDomain > domain()
returns domain
Definition: grid_function.h:342
SmartPtr< DoFDistribution > dof_distribution()
Definition: grid_function.h:236
lets you access layouts by type and key
Definition: parallel_grid_layout.h:152
@ SURFACE
Definition: grid_level.h:48
The base class for all geometric objects, such as vertices, edges, faces, volumes,...
Definition: grid_base_objects.h:157
The refiner interface allows to mark elements for refinement and to call refine.
Definition: refiner_interface.h:67
virtual RefinementMark get_mark(Vertex *v) const
Returns the mark of a given element. Default returns RM_REFINE.
Definition: refiner_interface.h:198
Definition: integrate.h:1073
Identifier for Local Finite Elements.
Definition: local_finite_element_id.h:98
@ CROUZEIX_RAVIART
Definition: local_finite_element_id.h:105
@ PIECEWISE_CONSTANT
Definition: local_finite_element_id.h:106
@ LAGRANGE
Definition: local_finite_element_id.h:104
virtual size_t num_sh() const
Definition: local_dof_set.cpp:46
virtual base class for local shape function sets
Definition: local_shape_function_set.h:70
virtual void grads(grad_type *vGrad, const MathVector< dim > &x) const =0
returns all gradients evaluated at a point
Container which holds an array of pointers.
Definition: pointer_const_array.h:84
size_t size() const
returns the size of the associated array.
Definition: pointer_const_array_impl.hpp:106
Definition: reference_element.h:345
size_t num(int dim) const
returns the number of geometric objects of dim
Definition: reference_element.h:95
int id(int dim_i, size_t i, int dim_j, size_t j) const
id of object j in dimension dim_j of obj i in dimension dim_i
Definition: reference_element.h:127
Definition: reference_element.h:445
Definition: reference_element.h:394
Definition: reference_element.h:303
Represents the surface view of a multi-grid hierarchy.
Definition: surface_view.h:61
@ SHADOW_RIM
Definition: surface_view.h:98
@ SURFACE_RIM
Definition: surface_view.h:94
SurfaceState surface_state(TElem *elem, const GridLevel &gl) const
returns the surface states, when considered as part of grid level
Type based UserData.
Definition: user_data.h:143
For arbitrary UserData , this class defines the integrand .
Definition: integrate.h:468
Base-class for all vertex-types.
Definition: grid_base_objects.h:231
number ElementDiameter(const TElem &elem, TDomain &domain)
returns the maximal distance between to element vertices
number ElementDiameterSq(const TElem &elem, TDomain &domain)
returns the maximal squared distance between to element vertices
void CollectCornerCoordinates(std::vector< typename TAAPos::ValueType > &vCornerCoordsOut, const TElem &elem, const TAAPos &aaPos, bool clearContainer=true)
returns the corner coordinates of a geometric object
Definition: domain_util_impl.h:75
void SetAttachmentValues(TAttachmentAccessor &aaVal, TIter elemsBegin, TIter elemsEnd, const TVal &val)
sets attachment-values for elements between elemsBegin and elemsEnd.
Definition: attachment_util_impl.hpp:44
TAAPos::ValueType CalculateOuterNormal(Vertex *v, int sideIndex, TAAPos aaPos)
Calculates the outer normal of the i-th side of the given grid object.
Definition: normal_calculation_impl.h:44
@ RM_REFINE
DEPRECATED. Use RM_FULL instead.
Definition: refiner_interface.h:55
@ RM_ANISOTROPIC
DEPRECATED. Use RM_CLOSURE instead.
Definition: refiner_interface.h:52
number CalculateVolume(Volume *elem, TAAPos aaPos)
Calculates the volume of the given element.
Definition: volume_calculation_impl.hpp:43
#define PCL_RO_SUM
Definition: pcl_methods.h:63
#define PCL_RO_MAX
Definition: pcl_methods.h:61
#define PCL_RO_MIN
Definition: pcl_methods.h:62
#define UG_THROW(msg)
Definition: error.h:57
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
double number
Definition: types.h:124
void MatVecMult(vector_t_out &vOut, const matrix_t &m, const vector_t_in &v)
Matrix - Vector Multiplication.
Definition: math_matrix_vector_functions_common_impl.hpp:49
TNumber sq(TNumber val)
returns the square of a value (val*val)
Definition: math_util_impl.hpp:91
void VecSet(vector_t &vInOut, typename vector_t::value_type s)
Set each vector component to scalar (componentwise)
Definition: math_vector_functions_common_impl.hpp:539
vector_t::value_type VecDistance(const vector_t &v1, const vector_t &v2)
returns the distance of two vector_ts.
Definition: math_vector_functions_common_impl.hpp:375
vector_t::value_type VecTwoNorm(const vector_t &v)
Definition: math_vector_functions_common_impl.hpp:577
vector_t::value_type VecDot(const vector_t &v1, const vector_t &v2)
returns the dot-product of two vector_ts
Definition: math_vector_functions_common_impl.hpp:385
Definition: smart_pointer.h:814
void EvaluateResidualErrorP1(SmartPtr< TFunction > u, SmartPtr< UserData< number, TFunction::dim > > f, const char *cmp, number time, int quadOrder, std::string quadType, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError)
Evaluates the residual error for P1 shape functions (with some simplifications)
Definition: error_indicator.h:1074
void MarkForAdaption_AbsoluteGradientJumpIndicator(IRefiner &refiner, GridFunction< TDomain, TAlgebra > &u, const char *fctName, number refTol, number coarsenTol, int minLvl, int maxLevel)
Definition: error_indicator.h:547
void MarkForAdaption_AbsoluteGradientIndicator(IRefiner &refiner, GridFunction< TDomain, TAlgebra > &u, const char *fctName, number refTol, number coarsenTol, int minLvl, int maxLevel)
Definition: error_indicator.h:413
void MarkForAdaption_GradientAverage(IRefiner &refiner, SmartPtr< GridFunction< TDomain, TAlgebra > > u, const char *cmp, number refFrac, int minLvl, int maxLvl)
Definition: error_indicator.h:1276
ReferenceObjectID
these ids are used to identify the shape of a geometric object.
Definition: grid_base_objects.h:74
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition: multi_index.h:276
void MarkForAdaption_GradientJump(IRefiner &refiner, SmartPtr< GridFunction< TDomain, TAlgebra > > u, const char *cmp, number refFrac, int minLvl, int maxLvl, std::string jumpType)
Definition: error_indicator.h:1006
void MarkElementsAbsolute(MultiGrid::AttachmentAccessor< TElem, ug::Attachment< number > > &aaError, IRefiner &refiner, ConstSmartPtr< DoFDistribution > dd, number refTol, number coarsenTol, int minLevel, int maxLevel, bool refTopLvlOnly=false)
marks elements according to an attached error value field
Definition: error_indicator_util.h:497
void EvaluateGradientJump_Norm(TFunction &u, size_t fct, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError)
Definition: error_indicator.h:914
void ComputeGradientCrouzeixRaviart(TFunction &u, size_t fct, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError)
Definition: error_indicator.h:149
void ExchangeAndAdjustSideErrors(TFunction &u, ANumber aSideError, ANumber aNumElems)
Definition: error_indicator.h:714
void MarkForAdaption_ResidualErrorP1Relative(IRefiner &refiner, SmartPtr< GridFunction< TDomain, TAlgebra > > u, SmartPtr< UserData< number, TDomain::dim > > f, const char *cmp, number time, number refFrac, int minLvl, int maxLvl, int quadOrder, std::string quadType)
Definition: error_indicator.h:1220
@ INT_V_MASTER
vertical master node
Definition: parallel_grid_layout.h:106
@ INT_H_MASTER
horizontal master node
Definition: parallel_grid_layout.h:104
@ INT_H_SLAVE
horizontal slave node
Definition: parallel_grid_layout.h:105
@ INT_V_SLAVE
vertical slave node
Definition: parallel_grid_layout.h:107
void MarkForAdaption_GradientJumpIndicator(IRefiner &refiner, GridFunction< TDomain, TAlgebra > &u, const char *fctName, number TOL, number refineFrac, number coarseFrac, int maxLevel)
Definition: error_indicator.h:497
Attachment< number > ANumber
Definition: common_attachments.h:57
void EvaluateGradientJump_SideIntegral(TFunction &u, size_t fct, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError, bool addErrSquareToAAError=false)
Definition: error_indicator.h:827
void computeGradientJump(TFunction &u, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaGrad, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError)
Definition: error_indicator.h:460
void ComputeGradientPiecewiseConstant(TFunction &u, size_t fct, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError)
Definition: error_indicator.h:270
void MarkForAdaption_GradientIndicator(IRefiner &refiner, GridFunction< TDomain, TAlgebra > &u, const char *fctName, number TOL, number refineFrac, number coarseFrac, int maxLevel)
Definition: error_indicator.h:367
number MarkForAdaption_ResidualErrorP1Absolute(IRefiner &refiner, SmartPtr< GridFunction< TDomain, TAlgebra > > u, SmartPtr< UserData< number, TDomain::dim > > f, const char *cmp, number time, number refTol, number coarsenTol, int maxLvl, int quadOrder, std::string quadType, bool refTopLvlOnly=false)
Definition: error_indicator.h:1144
void MarkForAdaption_L2ErrorExact(IRefiner &refiner, SmartPtr< GridFunction< TDomain, TAlgebra > > u, SmartPtr< UserData< number, TDomain::dim > > spExactSol, const char *cmp, number minL2Error, number maxL2Error, number refFrac, int minLvl, int maxLvl, number time, int quadOrder)
Definition: error_indicator.h:601
void ComputeGradientLagrange1(TFunction &u, size_t fct, MultiGrid::AttachmentAccessor< typename TFunction::element_type, ug::Attachment< number > > &aaError)
Definition: error_indicator.h:59
#define PROFILE_FUNC()
Definition: profiler.h:257
The traits class holds some important types for each element-type.
Definition: grid.h:136
geometry_traits< TElem >::iterator iterator
Definition: grid.h:143
ReferenceVertex face_type1
Definition: error_indicator.h:254
ReferenceVertex face_type0
Definition: error_indicator.h:253
ReferenceEdge face_type0
Definition: error_indicator.h:259
ReferenceEdge face_type1
Definition: error_indicator.h:260
ReferenceTriangle face_type0
Definition: error_indicator.h:265
ReferenceQuadrilateral face_type1
Definition: error_indicator.h:266
Definition: active_set_impl.h:45
void face_type0
Definition: error_indicator.h:247
void face_type1
Definition: error_indicator.h:248