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;
120 std::map<std::string, Omega_h_Transfer> type_map;
121 std::map<std::string, std::string> integral_map;
122 std::map<std::string, std::string>
123 velocity_density_map;
124 std::map<std::string, std::string>
125 velocity_momentum_map;
126 std::map<std::string, VarCompareOpts>
127 integral_diffuse_map;
128 std::shared_ptr<UserTransfer> user_xfer;
129 void validate(
Mesh* mesh)
const;
132 enum Verbosity { SILENT, EACH_ADAPT, EACH_REBUILD, EXTRA_STATS };
134 #ifdef OMEGA_H_USE_EGADS
142 Real min_length_desired;
143 Real max_length_desired;
144 Real max_length_allowed;
145 Real min_quality_allowed;
146 Real min_quality_desired;
149 Real length_histogram_min;
150 Real length_histogram_max;
151 Int nlength_histogram_bins;
152 Int nquality_histogram_bins;
153 #ifdef OMEGA_H_USE_EGADS
155 bool should_smooth_snap;
156 Real snap_smooth_tolerance;
157 bool allow_snap_failure;
162 bool should_coarsen_slivers;
163 bool should_prevent_coarsen_flip;
173 void print_adapt_histograms(
Mesh* mesh,
AdaptOpts const& opts);
175 void fix_momentum_velocity_verts(
176 Mesh* mesh, std::vector<ClassPair>
const& class_pairs, Int comp);
179 bool exit_on_stall =
false, Int max_niters = 40);
180 bool approach_metric(
Mesh* mesh,
AdaptOpts const& opts, Real min_step = 1e-4);
185 std::string tag_name;
186 Omega_h_Isotropy isotropy;
187 Omega_h_Scales scales;
190 std::string
const& tag_name_ =
"",
191 Omega_h_Isotropy isotropy_ = OMEGA_H_ANISOTROPIC,
192 Omega_h_Scales scales_ = OMEGA_H_SCALES);
198 std::vector<MetricSource> sources;
199 bool should_limit_lengths;
202 bool should_limit_gradation;
203 Real max_gradation_rate;
204 Real gradation_convergence_tolerance;
205 bool should_limit_element_count;
206 Real max_element_count;
207 Real min_element_count;
208 Real element_count_over_relaxation;
209 Int nsmoothing_steps;
215 Mesh* mesh,
Reals metrics, std::string
const& name =
"metric");
218 void add_implied_metric_tag(
Mesh* mesh);
219 void add_implied_isos_tag(
Mesh* mesh);
220 void add_implied_metric_based_on_target(
Mesh* mesh);
222 void fix(
Mesh* mesh,
AdaptOpts const& adapt_opts, Omega_h_Isotropy isotropy,
224 void fix_for_given_metric(
227 void grade_fix_adapt(
230 void add_rcField_transferMap(
AdaptOpts *opts, std::string
const &name,
231 Omega_h_Transfer
const transfer);
232 void add_rcField_integralMap(
AdaptOpts *opts, std::string
const &name,
233 std::string
const &
map);
Definition: Omega_h_mesh.hpp:35
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_adapt.hpp:138
Definition: Omega_h_adj.hpp:11
Definition: Omega_h_egads.cpp:83
Definition: Omega_h_adapt.hpp:182
Definition: Omega_h_adapt.hpp:118
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.
Definition: Omega_h_rbtree.hpp:1039