Skip to content

Commit

Permalink
Remove template argument added in !779
Browse files Browse the repository at this point in the history
Remove template argument added in !779. Following !785 this argument is no longer necessary

See merge request gysela-developpers/gyselalibxx!800

--------------------------------------------
  • Loading branch information
EmilyBourne committed Dec 10, 2024
1 parent de11d7a commit 1dd3963
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 37 deletions.
4 changes: 1 addition & 3 deletions simulations/geometryRTheta/diocotron/diocotron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ using PoissonSolver = PolarSplineFEMPoissonLikeSolver<
using DiscreteMappingBuilder
= DiscreteToCartesianBuilder<X, Y, SplineRThetaBuilder, SplineRThetaEvaluatorConstBound>;
using LogicalToPhysicalMapping = CircularToCartesian<R, Theta, X, Y>;
using PhysicalToLogicalMapping = CartesianToCircular<X, Y, R, Theta>;

namespace fs = std::filesystem;

Expand Down Expand Up @@ -116,7 +115,6 @@ int main(int argc, char** argv)
ddc::PeriodicExtrapolationRule<Theta>());

const LogicalToPhysicalMapping to_physical_mapping;
const PhysicalToLogicalMapping to_logical_mapping;
DiscreteMappingBuilder const discrete_mapping_builder(
Kokkos::DefaultHostExecutionSpace(),
to_physical_mapping,
Expand Down Expand Up @@ -166,7 +164,7 @@ int main(int argc, char** argv)

PreallocatableSplineInterpolatorRTheta interpolator(builder, spline_evaluator);

AdvectionPhysicalDomain advection_domain(to_physical_mapping, to_logical_mapping);
AdvectionPhysicalDomain advection_domain(to_physical_mapping);

SplineFootFinder find_feet(
time_stepper,
Expand Down
4 changes: 1 addition & 3 deletions simulations/geometryRTheta/vortex_merger/vortex_merger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ using PoissonSolver = PolarSplineFEMPoissonLikeSolver<
using DiscreteMappingBuilder
= DiscreteToCartesianBuilder<X, Y, SplineRThetaBuilder, SplineRThetaEvaluatorConstBound>;
using LogicalToPhysicalMapping = CircularToCartesian<R, Theta, X, Y>;
using PhysicalToLogicalMapping = CartesianToCircular<X, Y, R, Theta>;

} // end namespace

Expand Down Expand Up @@ -111,7 +110,6 @@ int main(int argc, char** argv)
ddc::PeriodicExtrapolationRule<Theta>());

const LogicalToPhysicalMapping to_physical_mapping;
const PhysicalToLogicalMapping to_logical_mapping;
DiscreteMappingBuilder const discrete_mapping_builder(
Kokkos::DefaultHostExecutionSpace(),
to_physical_mapping,
Expand Down Expand Up @@ -141,7 +139,7 @@ int main(int argc, char** argv)

PreallocatableSplineInterpolatorRTheta interpolator(builder, spline_evaluator);

AdvectionPhysicalDomain advection_domain(to_physical_mapping, to_logical_mapping);
AdvectionPhysicalDomain advection_domain(to_physical_mapping);

SplineFootFinder find_feet(
time_stepper,
Expand Down
22 changes: 12 additions & 10 deletions src/geometryRTheta/advection/advection_domain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ class AdvectionDomain
*
*
*/
template <class LogicalToPhysicalMapping, class PhysicalToLogicalMapping>
template <class LogicalToPhysicalMapping>
class AdvectionPhysicalDomain : public AdvectionDomain<LogicalToPhysicalMapping>
{
static_assert(is_analytical_mapping_v<LogicalToPhysicalMapping>);

public:
/**
* @brief The first dimension in the advection domain.
Expand All @@ -80,24 +82,24 @@ class AdvectionPhysicalDomain : public AdvectionDomain<LogicalToPhysicalMapping>
using CoordXY_adv = Coord<X_adv, Y_adv>;

private:
LogicalToPhysicalMapping const& m_to_cartesian_mapping;
PhysicalToLogicalMapping const& m_to_curvilinear_mapping;
using PhysicalToLogicalMapping = inverse_mapping_t<LogicalToPhysicalMapping>;

private:
LogicalToPhysicalMapping m_to_cartesian_mapping;
PhysicalToLogicalMapping m_to_curvilinear_mapping;

public:
/**
* @brief Instantiate a AdvectionPhysicalDomain advection domain.
*
* @param[in] to_physical_mapping
* The mapping from the logical domain to the physical domain.
* @param[in] to_logical_mapping
* The mapping from the physical domain to the logical domain.
*/
AdvectionPhysicalDomain(
LogicalToPhysicalMapping const& to_physical_mapping,
PhysicalToLogicalMapping const& to_logical_mapping)
AdvectionPhysicalDomain(LogicalToPhysicalMapping const& to_physical_mapping)
: m_to_cartesian_mapping(to_physical_mapping)
, m_to_curvilinear_mapping(to_logical_mapping) {};
~AdvectionPhysicalDomain() {};
, m_to_curvilinear_mapping(to_physical_mapping.get_inverse_mapping())
{
}

/**
* @brief Advect the characteristic feet.
Expand Down
6 changes: 2 additions & 4 deletions tests/geometryRTheta/advection_2d_rp/advection_all_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,8 @@ int main(int argc, char** argv)
spline_evaluator_extrapol);
DiscreteToCartesian const discrete_czarny_map = discrete_czarny_map_builder();

AdvectionPhysicalDomain<CircularToCartMapping, CartToCircularMapping> const
physical_circular_mapping(from_circ_map, to_circ_map);
AdvectionPhysicalDomain<CzarnyToCartMapping, CartToCzarnyMapping> const
physical_czarny_mapping(from_czarny_map, to_czarny_map);
AdvectionPhysicalDomain<CircularToCartMapping> const physical_circular_mapping(from_circ_map);
AdvectionPhysicalDomain<CzarnyToCartMapping> const physical_czarny_mapping(from_czarny_map);
AdvectionPseudoCartesianDomain<CzarnyToCartMapping> const pseudo_cartesian_czarny_mapping(
from_czarny_map);

Expand Down
20 changes: 6 additions & 14 deletions tests/geometryRTheta/advection_2d_rp/advection_selected_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,11 @@ namespace fs = std::filesystem;

namespace {
#if defined(CIRCULAR_MAPPING_PHYSICAL)
using X_adv = typename AdvectionPhysicalDomain<
CircularToCartesian<R, Theta, X, Y>,
CartesianToCircular<X, Y, R, Theta>>::X_adv;
using Y_adv = typename AdvectionPhysicalDomain<
CircularToCartesian<R, Theta, X, Y>,
CartesianToCircular<X, Y, R, Theta>>::Y_adv;
using X_adv = typename AdvectionPhysicalDomain<CircularToCartesian<R, Theta, X, Y>>::X_adv;
using Y_adv = typename AdvectionPhysicalDomain<CircularToCartesian<R, Theta, X, Y>>::Y_adv;
#elif defined(CZARNY_MAPPING_PHYSICAL)
using X_adv = typename AdvectionPhysicalDomain<
CzarnyToCartesian<R, Theta, X, Y>,
CartesianToCzarny<X, Y, R, Theta>>::X_adv;
using Y_adv = typename AdvectionPhysicalDomain<
CzarnyToCartesian<R, Theta, X, Y>,
CartesianToCzarny<X, Y, R, Theta>>::Y_adv;
using X_adv = typename AdvectionPhysicalDomain<CzarnyToCartesian<R, Theta, X, Y>>::X_adv;
using Y_adv = typename AdvectionPhysicalDomain<CzarnyToCartesian<R, Theta, X, Y>>::Y_adv;

#elif defined(CZARNY_MAPPING_PSEUDO_CARTESIAN)
using X_adv = typename AdvectionPseudoCartesianDomain<CzarnyToCartesian<R, Theta, X, Y>>::X_adv;
Expand Down Expand Up @@ -175,7 +167,7 @@ int main(int argc, char** argv)
CircularToCartesian<R, Theta, X, Y> analytical_mapping;
CircularToCartesian<R, Theta, X, Y> to_physical_mapping;
CartesianToCircular<X, Y, R, Theta> to_logical_mapping;
AdvectionPhysicalDomain advection_domain(analytical_mapping, to_logical_mapping);
AdvectionPhysicalDomain advection_domain(analytical_mapping);
std::string const mapping_name = "CIRCULAR";
std::string const adv_domain_name = "PHYSICAL";
key += "circular_physical";
Expand All @@ -188,7 +180,7 @@ int main(int argc, char** argv)
CzarnyToCartesian<R, Theta, X, Y> analytical_mapping(czarny_e, czarny_epsilon);
CzarnyToCartesian<R, Theta, X, Y> to_physical_mapping(czarny_e, czarny_epsilon);
CartesianToCzarny<X, Y, R, Theta> to_logical_mapping(czarny_e, czarny_epsilon);
AdvectionPhysicalDomain advection_domain(analytical_mapping, to_logical_mapping);
AdvectionPhysicalDomain advection_domain(analytical_mapping);
std::string const mapping_name = "CZARNY";
std::string const adv_domain_name = "PHYSICAL";
key += "czarny_physical";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ namespace {
using DiscreteMappingBuilder
= DiscreteToCartesianBuilder<X, Y, SplineRThetaBuilder, SplineRThetaEvaluatorConstBound>;
using LogicalToPhysicalMapping = CircularToCartesian<R, Theta, X, Y>;
using PhysicalToLogicalMapping = CartesianToCircular<X, Y, R, Theta>;

namespace fs = std::filesystem;

Expand Down Expand Up @@ -116,7 +115,6 @@ TEST(AdvectionFieldRThetaComputation, TestAdvectionFieldFinder)

// --- Define the to_physical_mapping. ------------------------------------------------------------------------
const LogicalToPhysicalMapping to_physical_mapping;
const PhysicalToLogicalMapping to_logical_mapping;
DiscreteMappingBuilder const discrete_mapping_builder(
Kokkos::DefaultHostExecutionSpace(),
to_physical_mapping,
Expand All @@ -137,7 +135,7 @@ TEST(AdvectionFieldRThetaComputation, TestAdvectionFieldFinder)

PreallocatableSplineInterpolatorRTheta interpolator(builder, spline_evaluator);

AdvectionPhysicalDomain advection_idx_range(to_physical_mapping, to_logical_mapping);
AdvectionPhysicalDomain advection_idx_range(to_physical_mapping);

RK3<host_t<FieldMemRTheta<CoordRTheta>>,
host_t<DVectorFieldMemRTheta<X, Y>>,
Expand Down

0 comments on commit 1dd3963

Please sign in to comment.