6#include <sll/mapping/cartesian_to_circular.hpp>
7#include <sll/mapping/circular_to_cartesian.hpp>
9#include "advection_domain.hpp"
10#include "ddc_alias_inline_functions.hpp"
11#include "ddc_aliases.hpp"
12#include "ddc_helper.hpp"
13#include "directional_tag.hpp"
14#include "geometry.hpp"
15#include "geometry_pseudo_cartesian.hpp"
17#include "vector_field.hpp"
18#include "vector_field_mem.hpp"
38template <
class LogicalToPhysicalMapping>
41 static_assert(is_analytical_mapping_v<LogicalToPhysicalMapping>);
44 using PhysicalToLogicalMapping = inverse_mapping_t<LogicalToPhysicalMapping>;
62 PhysicalToLogicalMapping m_to_curvilinear_mapping;
72 : m_to_cartesian_mapping(to_physical_mapping)
73 , m_to_curvilinear_mapping(to_physical_mapping.get_inverse_mapping())
114 host_t<FieldRTheta<CoordRTheta>> feet_coords_rp,
118 IdxRangeRTheta
const idx_range_rp = get_idx_range<GridR, GridTheta>(feet_coords_rp);
120 CoordXY_adv coord_center(m_to_cartesian_mapping(CoordRTheta(0, 0)));
122 ddc::for_each(idx_range_rp, [&](IdxRTheta
const irp) {
123 CoordRTheta
const coord_rp(feet_coords_rp(irp));
124 CoordXY_adv const coord_xy = m_to_cartesian_mapping(coord_rp);
126 CoordXY_adv const feet_xy = coord_xy - dt * advection_field(irp);
128 if (
norm_inf(feet_xy - coord_center) < 1e-15) {
129 feet_coords_rp(irp) = CoordRTheta(0, 0);
131 feet_coords_rp(irp) = m_to_curvilinear_mapping(feet_xy);
132 ddc::select<Theta>(feet_coords_rp(irp)) = ddcHelper::restrict_to_idx_range(
133 ddc::select<Theta>(feet_coords_rp(irp)),
134 IdxRangeTheta(idx_range_rp));
Define a domain for the advection.
Definition advection_domain.hpp:40
typename PhysicalToLogicalMapping::cartesian_tag_y Y_adv
The second dimension in the advection domain.
Definition advection_domain.hpp:54
Coord< X_adv, Y_adv > CoordXY_adv
The coordinate type associated to the dimensions in the advection domain.
Definition advection_domain.hpp:58
void advect_feet(host_t< FieldRTheta< CoordRTheta > > feet_coords_rp, host_t< DConstVectorFieldRTheta< X_adv, Y_adv > > advection_field, double dt) const
Advect the characteristic feet.
Definition advection_domain.hpp:113
typename PhysicalToLogicalMapping::cartesian_tag_x X_adv
The first dimension in the advection domain.
Definition advection_domain.hpp:50
AdvectionDomain(LogicalToPhysicalMapping const &to_physical_mapping)
Instantiate a AdvectionDomain advection domain.
Definition advection_domain.hpp:71
Y cartesian_tag_y
Indicate the second physical coordinate.
Definition cartesian_to_circular.hpp:45
X cartesian_tag_x
Indicate the first physical coordinate.
Definition cartesian_to_circular.hpp:43
A class for describing the circular 2D mapping.
Definition circular_to_cartesian.hpp:43
A class which holds multiple (scalar) fields in order to represent a vector field.
Definition vector_field.hpp:64