omega_h
Reliable mesh adaptation
Omega_h_compare.hpp
1 #ifndef OMEGA_H_COMPARE_HPP
2 #define OMEGA_H_COMPARE_HPP
3 
4 #include <map>
5 
6 #include <Omega_h_cmdline.hpp>
7 #include <Omega_h_comm.hpp>
8 #include <Omega_h_filesystem.hpp>
9 
10 namespace Omega_h {
11 
12 class Mesh;
13 
15  enum { NONE, RELATIVE, ABSOLUTE } type;
16  Real tolerance;
17  Real floor;
18  static VarCompareOpts zero_tolerance();
19  static VarCompareOpts defaults();
20  static VarCompareOpts none();
21 };
22 
24  std::map<std::string, VarCompareOpts> tags2opts[4];
25  VarCompareOpts time_step_opts;
26  VarCompareOpts tag_opts(int dim, std::string const& name) const;
27  static MeshCompareOpts init(Mesh const* mesh, VarCompareOpts var_opts);
28 };
29 
30 Real get_real_diff(Real a, Real b, VarCompareOpts opts);
31 bool compare_real(Real a, Real b, VarCompareOpts opts);
32 
33 template <typename T>
34 bool compare_arrays(CommPtr comm, Read<T> a, Read<T> b, VarCompareOpts opts,
35  Int ncomps, Int dim, bool verbose = true);
36 
37 Omega_h_Comparison compare_meshes(Mesh* a, Mesh* b, MeshCompareOpts const& opts,
38  bool verbose, bool full = true);
39 
40 bool check_same(Mesh* a, Mesh* b);
41 
42 bool check_regression(filesystem::path const& prefix, Mesh* mesh);
43 
44 void get_diff_program_cmdline(
45  std::string const& a_name, std::string const& b_name, CmdLine* p_cmdline);
46 
47 void accept_diff_program_cmdline(CmdLine const& cmdline, Mesh const* mesh,
48  MeshCompareOpts* p_opts, Omega_h_Comparison* p_max_result);
49 
50 #define OMEGA_H_EXPL_INST_DECL(T) \
51  extern template bool compare_arrays(CommPtr comm, Read<T> a, Read<T> b, \
52  VarCompareOpts opts, Int ncomps, Int dim, bool verbose);
53 OMEGA_H_EXPL_INST_DECL(I8)
54 OMEGA_H_EXPL_INST_DECL(I32)
55 OMEGA_H_EXPL_INST_DECL(I64)
56 OMEGA_H_EXPL_INST_DECL(Real)
57 #undef OMEGA_H_EXPL_INST_DECL
58 
59 } // end namespace Omega_h
60 
61 #endif
Definition: Omega_h_cmdline.hpp:57
Definition: Omega_h_mesh.hpp:35
Definition: Omega_h_array.hpp:89
Definition: Omega_h_filesystem.hpp:22
Definition: amr_mpi_test.cpp:6
Definition: Omega_h_compare.hpp:23
Definition: Omega_h_compare.hpp:14