1 #ifndef OMEGA_H_ADAPT_HPP
2 #define OMEGA_H_ADAPT_HPP
6 #include <Omega_h_config.h>
7 #include <Omega_h_compare.hpp>
8 #include <Omega_h_defines.hpp>
9 #include <Omega_h_mark.hpp>
28 virtual void out_of_line_virtual_method();
51 LOs keys2midverts, Int prod_dim,
LOs keys2prods,
LOs prods2new_ents,
52 LOs same_ents2old_ents,
LOs same_ents2new_ents) = 0;
75 Adj keys2doms, Int prod_dim,
LOs prods2new_ents,
LOs same_ents2old_ents,
76 LOs same_ents2new_ents) = 0;
97 LOs keys2edges,
LOs keys2prods,
LOs prods2new_ents,
98 LOs same_ents2old_ents,
LOs same_ents2new_ents) = 0;
138 std::map<std::string, Omega_h_Transfer> type_map;
139 std::map<std::string, std::string> integral_map;
140 std::map<std::string, std::string>
141 velocity_density_map;
142 std::map<std::string, std::string>
143 velocity_momentum_map;
144 std::map<std::string, VarCompareOpts>
145 integral_diffuse_map;
146 std::shared_ptr<UserTransfer> user_xfer;
147 void validate(
Mesh* mesh)
const;
150 enum Verbosity { SILENT, EACH_ADAPT, EACH_REBUILD, EXTRA_STATS };
152 #ifdef OMEGA_H_USE_EGADS
160 Real min_length_desired;
161 Real max_length_desired;
162 Real max_length_allowed;
163 Real min_quality_allowed;
164 Real min_quality_desired;
167 Real length_histogram_min;
168 Real length_histogram_max;
169 Int nlength_histogram_bins;
170 Int nquality_histogram_bins;
171 #ifdef OMEGA_H_USE_EGADS
173 bool should_smooth_snap;
174 Real snap_smooth_tolerance;
175 bool allow_snap_failure;
180 bool should_coarsen_slivers;
181 bool should_prevent_coarsen_flip;
191 void print_adapt_histograms(
Mesh* mesh,
AdaptOpts const& opts);
193 void fix_momentum_velocity_verts(
194 Mesh* mesh, std::vector<ClassPair>
const& class_pairs, Int comp);
197 bool exit_on_stall =
false, Int max_niters = 40);
198 bool approach_metric(
Mesh* mesh,
AdaptOpts const& opts, Real min_step = 1e-4);
203 std::string tag_name;
204 Omega_h_Isotropy isotropy;
205 Omega_h_Scales scales;
208 std::string
const& tag_name_ =
"",
209 Omega_h_Isotropy isotropy_ = OMEGA_H_ANISOTROPIC,
210 Omega_h_Scales scales_ = OMEGA_H_SCALES);
216 std::vector<MetricSource> sources;
217 bool should_limit_lengths;
220 bool should_limit_gradation;
221 Real max_gradation_rate;
222 Real gradation_convergence_tolerance;
223 bool should_limit_element_count;
224 Real max_element_count;
225 Real min_element_count;
226 Real element_count_over_relaxation;
227 Int nsmoothing_steps;
233 Mesh* mesh,
Reals metrics, std::string
const& name =
"metric");
236 void add_implied_metric_tag(
Mesh* mesh);
237 void add_implied_isos_tag(
Mesh* mesh);
238 void add_implied_metric_based_on_target(
Mesh* mesh);
240 void fix(
Mesh* mesh,
AdaptOpts const& adapt_opts, Omega_h_Isotropy isotropy,
242 void fix_for_given_metric(
245 void grade_fix_adapt(
248 void add_rcField_transferMap(
AdaptOpts *opts, std::string
const &name,
249 Omega_h_Transfer
const transfer);
250 void add_rcField_integralMap(
AdaptOpts *opts, std::string
const &name,
251 std::string
const &
map);
Definition: Omega_h_mesh.hpp:35
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_adapt.hpp:156
Definition: Omega_h_adj.hpp:11
Definition: Omega_h_egads.cpp:83
Definition: Omega_h_adapt.hpp:200
Definition: Omega_h_adapt.hpp:136
Application hook for custom field transfer during mesh adaptation.
Definition: Omega_h_adapt.hpp:26
virtual void swap(Mesh &old_mesh, Mesh &new_mesh, Int prod_dim, LOs keys2edges, LOs keys2prods, LOs prods2new_ents, LOs same_ents2old_ents, LOs same_ents2new_ents)=0
Transfer fields during edge/face swaps.
virtual void swap_copy_verts(Mesh &old_mesh, Mesh &new_mesh)=0
Transfer vertex fields during swaps when custom processing needed.
virtual void refine(Mesh &old_mesh, Mesh &new_mesh, LOs keys2edges, LOs keys2midverts, Int prod_dim, LOs keys2prods, LOs prods2new_ents, LOs same_ents2old_ents, LOs same_ents2new_ents)=0
Transfer fields during edge refinement.
virtual void coarsen(Mesh &old_mesh, Mesh &new_mesh, LOs keys2verts, Adj keys2doms, Int prod_dim, LOs prods2new_ents, LOs same_ents2old_ents, LOs same_ents2new_ents)=0
Transfer fields during edge collapse/coarsening.
virtual void snap(Mesh &mesh, const Reals &old_coords, const Reals &warp)=0
Transfer fields during vertex snap.
Definition: Omega_h_rbtree.hpp:1039