45 template <
typename TGr
idFunction,
typename TBaseElem>
55 typedef typename TGridFunction::template traits<TBaseElem>::const_iterator elem_it;
59 Grid& grid = *refiner->grid();
61 unsigned long nMarked = 0;
65 std::vector<DoFIndex> vDI;
66 elem_it it = u->template begin<TBaseElem>();
67 elem_it itEnd = u->template end<TBaseElem>();
68 for (; it != itEnd; ++it)
73 const size_t nInd = u->inner_dof_indices(elem, cmp, vDI,
true);
74 for (
size_t i = 0; i < nInd; ++i)
77 if (val < lowerBnd || val > upperBnd)
81 const size_t elSz = el.size();
82 for (
size_t e = 0; e < elSz; ++e)
84 if (refiner->get_mark(el[e]) ==
RM_NONE)
97 template <
typename TGr
idFunction>
107 unsigned long nMarked = 0;
108 if (u->max_fct_dofs(cmp, 0))
109 nMarked += MarkOutOfRangeElems<TGridFunction, Vertex>(refiner, u, cmp, lowerBnd, upperBnd);
110 if (u->max_fct_dofs(cmp, 1))
111 nMarked += MarkOutOfRangeElems<TGridFunction, Edge>(refiner, u, cmp, lowerBnd, upperBnd);
112 if (u->max_fct_dofs(cmp, 2))
113 nMarked += MarkOutOfRangeElems<TGridFunction, Face>(refiner, u, cmp, lowerBnd, upperBnd);
114 if (u->max_fct_dofs(cmp, 3))
115 nMarked += MarkOutOfRangeElems<TGridFunction, Volume>(refiner, u, cmp, lowerBnd, upperBnd);
127 UG_LOGN(
" +++ Marked for refinement: " << nMarked <<
" elements.");
Definition: smart_pointer.h:296
Definition: smart_pointer.h:108
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
Manages the elements of a grid and their interconnection.
Definition: grid.h:132
void associated_elements(traits< Vertex >::secure_container &elemsOut, TElem *e)
Puts all elements of type TAss which are contained in 'e' or which contain 'e' into elemsOut.
Definition: grid_impl.hpp:466
Container which holds an array of pointers.
Definition: pointer_const_array.h:84
@ RM_NONE
no refinement is performed
Definition: refiner_interface.h:49
@ RM_FULL
Fully refines an element and all associated sides and edges.
Definition: refiner_interface.h:54
#define PCL_RO_SUM
Definition: pcl_methods.h:63
int NumProcs()
returns the number of processes
Definition: pcl_base.cpp:91
base_type::TBaseElem TBaseElem
#define UG_LOGN(msg)
Definition: log.h:369
double number
Definition: types.h:124
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition: multi_index.h:276
void MarkOutOfRangeElems(SmartPtr< IRefiner > refiner, ConstSmartPtr< TGridFunction > u, size_t cmp, number lowerBnd, number upperBnd)
Definition: marking_utils_impl.h:99
Definition: domain_traits.h:53