Store the information related to the size of the simulation box to convert patch integer coordinates to floating point ones.
More...
#include <shamrock/include/shamrock/patch/SimBox.hpp>
Store the information related to the size of the simulation box to convert patch integer coordinates to floating point ones.
Definition at line 35 of file SimBox.hpp.
◆ SimulationBoxInfo()
◆ allreduce_set_bounding_box()
template<class T >
| void shamrock::patch::SimulationBoxInfo::allreduce_set_bounding_box |
( |
shammath::CoordRange< T > |
new_box | ) |
|
|
inline |
Set the stored bounding box after an all-reduce operation on the supplied bounds.
This function is used in the context of a distributed simulation. It will all-reduce the bounding box of the domain over all the MPI ranks. The all-reduce operation is done with the shamalgs::collective::allreduce_bounds function.
- Template Parameters
-
- Parameters
-
| new_box | the new bounding box to be all_reduced across ranks |
Definition at line 113 of file SimBox.hpp.
◆ clean_box() [1/3]
template<>
| void shamrock::patch::SimulationBoxInfo::clean_box |
( |
f32 |
tol | ) |
|
|
inline |
◆ clean_box() [2/3]
template<>
| void shamrock::patch::SimulationBoxInfo::clean_box |
( |
f64 |
tol | ) |
|
|
inline |
◆ clean_box() [3/3]
template<class primtype >
| void shamrock::patch::SimulationBoxInfo::clean_box |
( |
primtype |
tol | ) |
|
- Todo:
- replace vectype primtype in the code by primtype and sycl::vec<primtype,3> for the others
◆ from_json()
| void shamrock::patch::SimulationBoxInfo::from_json |
( |
const nlohmann::json & |
j | ) |
|
◆ get_bounding_box()
template<class T >
| std::tuple< T, T > shamrock::patch::SimulationBoxInfo::get_bounding_box |
( |
| ) |
const |
|
inline |
Get the stored bounding box of the domain.
- Template Parameters
-
- Returns
- std::tuple<T, T> return [low bound, high bound[
Definition at line 247 of file SimBox.hpp.
◆ get_bounding_box_size()
template<class T >
| T shamrock::patch::SimulationBoxInfo::get_bounding_box_size |
( |
| ) |
const |
|
inline |
Get the size of the stored bounding box of the domain.
- Template Parameters
-
- Returns
- T the size of the bounding box
Definition at line 87 of file SimBox.hpp.
◆ get_box()
template<class primtype >
| std::tuple< sycl::vec< primtype, 3 >, sycl::vec< primtype, 3 > > shamrock::patch::SimulationBoxInfo::get_box |
( |
Patch & |
p | ) |
|
|
inline |
◆ get_patch_transform()
Get a PatchCoordTransform object that describes the conversion between patch coordinates and domain coordinates.
This function returns a PatchCoordTransform object that can be used to convert between patch coordinates and domain coordinates. The PatchCoordTransform object is templated on the type of position vector used by the domain.
- Template Parameters
-
- Returns
- PatchCoordTransform<T> A PatchCoordTransform object that can be used to transform between patch coordinates and domain coordinates.
Definition at line 285 of file SimBox.hpp.
◆ get_transform()
◆ patch_coord_to_domain()
template<class T >
| std::tuple< T, T > shamrock::patch::SimulationBoxInfo::patch_coord_to_domain |
( |
const Patch & |
p | ) |
const |
|
inline |
get the patch coordinates on the domain
- Template Parameters
-
- Parameters
-
- Returns
- std::tuple<T,T> the [low bound, high bound[ coordinate of the patch in the domain
Definition at line 300 of file SimBox.hpp.
◆ reset_box_size()
| void shamrock::patch::SimulationBoxInfo::reset_box_size |
( |
| ) |
|
|
inline |
Reset the bounding box of the simulation domain to the maximum extents of the main field.
This function resets the bounding box of the simulation domain to the maximum extents of the main field. The bounding box is defined by the PatchDataLayerLayout object used to initialize the SimulationBoxInfo object. The bounding box is a shammath::CoordRange object that contains the coordinate range of the simulation domain.
This function is called by the constructor of the SimulationBoxInfo class, but it can also be called manually to reset the bounding box after changing the main field.
The bounding box is reset based on the type of the main field. If the main field is of type f32_3, f64_3, u32_3, u64_3, or i64_3, the bounding box is set to the maximum range of the corresponding type. If the main field is of any other type, a std::runtime_error exception is thrown.
- Exceptions
-
| std::runtime_error | if the main field type is not one of the types listed above. |
Definition at line 309 of file SimBox.hpp.
◆ set_bounding_box()
Override the stored bounding box by the one given in new_box.
- Template Parameters
-
- Parameters
-
| new_box | the new bounding box |
Definition at line 272 of file SimBox.hpp.
◆ set_patch_coord_bounding_box()
| void shamrock::patch::SimulationBoxInfo::set_patch_coord_bounding_box |
( |
PatchCoord< dim > |
new_patch_coord_box | ) |
|
|
inline |
◆ to_json()
| void shamrock::patch::SimulationBoxInfo::to_json |
( |
nlohmann::json & |
j | ) |
|
The documentation for this class was generated from the following files: