19 #include <gsAssembler/gsAdaptiveMeshingCompare.h>
47 typedef typename HBox::SortedContainer boxContainer;
48 typedef std::map<gsHBox<2,T>,
index_t,gsHBoxCompare<2,T>> indexMapType;
49 typedef std::map<index_t,gsHBox<2,T>*> boxMapType;
62 void defaultOptions();
68 void container_into(
const std::vector<T> & elError,
HBoxContainer & result);
70 void markRef_into(
const std::vector<T> & elError,
HBoxContainer & elMarked);
73 void markCrs_into(
const std::vector<T> & elError,
HBoxContainer & elMarked);
75 void markRef(
const std::vector<T> & errors);
76 void markCrs(
const std::vector<T> & errors);
81 bool refine(
const std::vector<bool> & markedRef) {
return refine(_toContainer(markedRef)); }
82 bool unrefine(
const std::vector<bool> & markedCrs) {
return unrefine(_toContainer(markedCrs)); };
84 bool refine() {
return refine(m_markedRef); }
85 bool unrefine() {
return unrefine(m_markedRef); };
99 void assignErrors(
const std::vector<T> & elError);
100 T blockedError()
const;
101 T nonBlockedError()
const;
104 void _makeMap(
const gsFunctionSet<T> * input,
typename gsAdaptiveMeshing<T>::indexMapType & indexMap,
typename gsAdaptiveMeshing<T>::boxMapType & boxMap);
106 void _assignErrors(boxMapType & container,
const std::vector<T> & elError);
112 void _unrefineMarkedElements(
const HBoxContainer & container,
119 std::vector<index_t> _sortPermutation(
const boxMapType & container);
120 std::vector<index_t> _sortPermutationProjectedRef(
const boxMapType & container);
121 std::vector<index_t> _sortPermutationProjectedCrs(
const boxMapType & container);
128 template<
bool _coarsen,
bool _admissible>
131 template<
bool _coarsen,
bool _admissible>
134 _markFraction_impl<_coarsen,_admissible>(elements,predicates,elMarked);
136 template<
bool _coarsen,
bool _admissible>
137 typename std::enable_if< _coarsen && _admissible, void>::type
140 template<
bool _coarsen,
bool _admissible>
141 typename std::enable_if< _coarsen && !_admissible, void>::type
144 template<
bool _coarsen,
bool _admissible>
145 typename std::enable_if<!_coarsen && _admissible, void>::type
148 template<
bool _coarsen,
bool _admissible>
149 typename std::enable_if<!_coarsen && !_admissible, void>::type
152 template<
bool _coarsen,
bool _admissible>
155 _markProjectedFraction_impl<_coarsen,_admissible>(elements,predicates,elMarked);
157 template<
bool _coarsen,
bool _admissible>
158 typename std::enable_if< _coarsen && _admissible, void>::type
161 template<
bool _coarsen,
bool _admissible>
162 typename std::enable_if< _coarsen && !_admissible, void>::type
165 template<
bool _coarsen,
bool _admissible>
166 typename std::enable_if<!_coarsen && _admissible, void>::type
169 template<
bool _coarsen,
bool _admissible>
170 typename std::enable_if<!_coarsen && !_admissible, void>::type
174 template<
bool _coarsen,
bool _admissible>
177 _markPercentage_impl<_coarsen,_admissible>(elements,predicates,elMarked);
179 template<
bool _coarsen,
bool _admissible>
180 typename std::enable_if< _coarsen && _admissible, void>::type
183 template<
bool _coarsen,
bool _admissible>
184 typename std::enable_if< _coarsen && !_admissible, void>::type
187 template<
bool _coarsen,
bool _admissible>
188 typename std::enable_if<!_coarsen && _admissible, void>::type
191 template<
bool _coarsen,
bool _admissible>
192 typename std::enable_if<!_coarsen && !_admissible, void>::type
195 template<
bool _coarsen,
bool _admissible>
198 _markThreshold_impl<_coarsen,_admissible>(elements,predicates,elMarked);
200 template<
bool _coarsen,
bool _admissible>
201 typename std::enable_if< _coarsen && _admissible, void>::type
204 template<
bool _coarsen,
bool _admissible>
205 typename std::enable_if< _coarsen && !_admissible, void>::type
208 template<
bool _coarsen,
bool _admissible>
209 typename std::enable_if<!_coarsen && _admissible, void>::type
212 template<
bool _coarsen,
bool _admissible>
213 typename std::enable_if<!_coarsen && !_admissible, void>::type
217 bool _checkBoxes(
const typename HBox::Container & boxes,
const std::vector<
gsHBoxCheck<2,T> *> predicates)
const;
219 T _totalError(
const boxMapType & elements);
221 T _maxError(
const boxMapType & elements);
224 void _addAndMark(
typename HBox::Container & boxes,
HBoxContainer & elMarked)
const;
226 void _setContainerProperties(
typename HBox::Container & boxes )
const;
228 HBox * _boxPtr(
const HBox & box)
const;
238 T m_crsParam, m_crsParamExtra, m_refParam, m_refParamExtra;
239 MarkingStrategy m_crsRule, m_refRule;
254 indexMapType m_indices;
257 T m_totalError, m_maxError, m_uniformRefError, m_uniformCrsError;
259 std::vector<index_t> m_refPermutation, m_crsPermutation;
279 #ifndef GISMO_BUILD_LIB
280 #include GISMO_HPP_HEADER(gsAdaptiveMeshing.hpp)
282 #ifdef gsAdaptiveMeshing_EXPORT
283 #include GISMO_HPP_HEADER(gsAdaptiveMeshing.hpp)
284 #undef EXTERN_CLASS_TEMPLATE
285 #define EXTERN_CLASS_TEMPLATE CLASS_TEMPLATE_INST
289 EXTERN_CLASS_TEMPLATE gsAdaptiveMeshing<real_t>;
Provides utility functions for gsHBox and gsHBoxContainer.
Provides declaration of MultiBasis class.
Provides class for adaptive refinement.
This class provides a Hierarchical Box (gsHBox)
Definition: gsHBox.h:54
#define index_t
Definition: gsConfig.h:32
Provides a list of labeled parameters/options that can be set and accessed easily.
Provides declaration of the MultiPatch class.
Base class for performing checks on gsHBox objects.
Definition: gsAdaptiveMeshingCompare.h:31
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
Provides a container for gsHBox.
void _markElements(const std::vector< T > &elError, const index_t refCriterion, const std::vector< gsHBoxCheck< 2, T > * > &predicates, HBoxContainer &elMarked) const
Marks elements/cells for refinement.
Definition: gsAdaptiveMeshing.hpp:201
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
The gsHBoxUtils provide basic utilities to modify HBoxes.
Definition: gsHBoxUtils.h:45
Provides adaptive meshing routines.
Definition: gsAdaptiveMeshing.h:41
Provides gsHBox: smart boxes for HTensorBases.