Added the Mesh_topology enum class. - #3490
Conversation
| return MeshTopology::connected_double_null; | ||
| } else { | ||
| return MeshTopology::unconnected_double_null; | ||
| } |
There was a problem hiding this comment.
warning: do not use 'else' after 'return' [readability-else-after-return]
| } | |
| } if (jyseps2_1 == jyseps1_2) { | |
| return MeshTopology::single_null; | |
| } else if (ixseps1 == ixseps2) { | |
| return MeshTopology::connected_double_null; | |
| } else { | |
| return MeshTopology::unconnected_double_null; | |
| } |
| if (NPES % (possible_nxpe * possible_nype) != 0) { | ||
| continue; | ||
| } | ||
| int possible_npes = possible_nxpe * possible_nype; |
There was a problem hiding this comment.
warning: variable 'possible_npes' of type 'int' can be declared 'const' [misc-const-correctness]
| int possible_npes = possible_nxpe * possible_nype; | |
| int const possible_npes = possible_nxpe * possible_nype; |
| if (mesh_topology == MeshTopology::unconnected_double_null | ||
| || mesh_topology == MeshTopology::connected_double_null) { | ||
| if (not(jyseps1_1 < jyseps2_1 && jyseps2_1 < ny_inner | ||
| && ny_inner < jyseps1_2 && jyseps1_2 < jyseps2_2)) { |
There was a problem hiding this comment.
warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
| && ny_inner < jyseps1_2 && jyseps1_2 < jyseps2_2)) { | |
| if (jyseps1_1 >= jyseps2_1 || jyseps2_1 >= ny_inner | |
| || ny_inner >= jyseps1_2 || jyseps1_2 >= jyseps2_2) { |
|
|
||
| mesh_topology = getMeshTopology(jyseps1_1, jyseps2_1, jyseps1_2, jyseps2_2, ny_inner, | ||
| ixseps1, ixseps2); | ||
| output_info << _("Detected mesh topology = ") << toString(mesh_topology) << std::endl; |
There was a problem hiding this comment.
warning: do not use 'std::endl' with streams; use '\n' instead [performance-avoid-endl]
| output_info << _("Detected mesh topology = ") << toString(mesh_topology) << std::endl; | |
| output_info << _("Detected mesh topology = ") << toString(mesh_topology) << '\n'; |
| proc[1] = PROC_NUM(i, YPROC(jyseps2_2)); | ||
|
|
||
| output_debug << "CORE2 " << proc[0] << ", " << proc[1] << endl; | ||
| output_debug << "CORE2 " << proc[0] << ", " << proc[1] << endl; |
There was a problem hiding this comment.
warning: do not use 'endl' with streams; use '\n' instead [performance-avoid-endl]
| output_debug << "CORE2 " << proc[0] << ", " << proc[1] << endl; | |
| output_debug << "CORE2 " << proc[0] << ", " << proc[1] << '\n'; |
| periodicX = periodic_X_; | ||
| setYDecompositionIndices(jyseps1_1_, jyseps2_1_, jyseps1_2_, jyseps2_2_, ny_inner_); | ||
| mesh_topology = getMeshTopology(jyseps1_1, jyseps2_1, jyseps1_2, jyseps2_2, ny_inner, | ||
| ixseps1, ixseps2); |
There was a problem hiding this comment.
warning: 'mesh_topology' should be initialized in a member initializer of the constructor [cppcoreguidelines-prefer-member-initializer]
src/mesh/impls/bout/boutmesh.cxx:2098:
- NYPE(nype), ixseps1(ixseps1_), ixseps2(ixseps2_), symmetricGlobalX(symmetric_X),
+ NYPE(nype), ixseps1(ixseps1_), ixseps2(ixseps2_), mesh_topology(getMeshTopology(jyseps1_1, jyseps2_1, jyseps1_2, jyseps2_2, ny_inner,
+ ixseps1, ixseps2)), symmetricGlobalX(symmetric_X),| ixseps1, ixseps2); | |
| /// Topology and communications compatible with BOUT | ||
| /// conventions. | ||
|
|
||
| BOUT_ENUM_CLASS(MeshTopology, |
There was a problem hiding this comment.
warning: no header providing "BOUT_ENUM_CLASS" is directly included [misc-include-cleaner]
src/mesh/impls/bout/boutmesh.hxx:6:
- #include "bout/bout_types.hxx"
+ #include "bout/bout_enum_class.hxx"
+ #include "bout/bout_types.hxx"
The getMeshTopology function identifies the current topology and the variable now stores the value so that it can be used anywhere.
To be expanded with the Snowflake and X-Point topology.