Skip to content

Commit

Permalink
Merge branch 'yannm_lagrange_instability' into 'main'
Browse files Browse the repository at this point in the history
Workaround for sheath simulation divergence

See merge request gysela-developpers/gyselalibxx!647
  • Loading branch information
EmilyBourne committed Aug 7, 2024
1 parent 1606fe2 commit fd13344
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
18 changes: 6 additions & 12 deletions simulations/geometryXVx/neutrals/neutrals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <paraconf.h>
#include <pdi.h>

#include "Lagrange_interpolator.hpp"
#include "bsl_advection_vx.hpp"
#include "bsl_advection_x.hpp"
#include "charge_exchange.hpp"
Expand Down Expand Up @@ -157,25 +156,20 @@ int main(int argc, char** argv)
ddc::ConstantExtrapolationRule<X> bv_x_max(ddc::coordinate(mesh_x.back()));
#endif

ddc::ConstantExtrapolationRule<Vx> bv_vx_min(ddc::coordinate(mesh_vx.front()));
ddc::ConstantExtrapolationRule<Vx> bv_vx_max(ddc::coordinate(mesh_vx.back()));

// Creating operators
SplineXEvaluator const spline_x_evaluator(bv_x_min, bv_x_max);
SplineVxEvaluator const spline_vx_evaluator(bv_vx_min, bv_vx_max);
#ifndef PERIODIC_RDIMX
SplineXEvaluator_1d const spline_x_evaluator_poisson(bv_x_min, bv_x_max);
#endif
PreallocatableSplineInterpolator const spline_x_interpolator(builder_x, spline_x_evaluator);

IdxStepVx static constexpr gwvx {0};
LagrangeInterpolator<GridVx, BCond::DIRICHLET, BCond::DIRICHLET, GridX, GridVx> const
lagrange_vx_non_preallocatable_interpolator(3, gwvx);
PreallocatableLagrangeInterpolator<
GridVx,
BCond::DIRICHLET,
BCond::DIRICHLET,
GridX,
GridVx> const lagrange_vx_interpolator(lagrange_vx_non_preallocatable_interpolator);
PreallocatableSplineInterpolator const spline_vx_interpolator(builder_vx, spline_vx_evaluator);

BslAdvectionSpatial<GeometryXVx, GridX> const advection_x(spline_x_interpolator);
BslAdvectionVelocity<GeometryXVx, GridVx> const advection_vx(lagrange_vx_interpolator);
BslAdvectionVelocity<GeometryXVx, GridVx> const advection_vx(spline_vx_interpolator);

// list of rhs operators
std::vector<std::reference_wrapper<IRightHandSide const>> rhs_operators;
Expand Down
18 changes: 6 additions & 12 deletions simulations/geometryXVx/sheath/sheath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <paraconf.h>
#include <pdi.h>

#include "Lagrange_interpolator.hpp"
#include "bsl_advection_vx.hpp"
#include "bsl_advection_x.hpp"
#include "chargedensitycalculator.hpp"
Expand Down Expand Up @@ -128,25 +127,20 @@ int main(int argc, char** argv)
ddc::ConstantExtrapolationRule<X> bv_x_max(ddc::coordinate(mesh_x.back()));
#endif

ddc::ConstantExtrapolationRule<Vx> bv_vx_min(ddc::coordinate(mesh_vx.front()));
ddc::ConstantExtrapolationRule<Vx> bv_vx_max(ddc::coordinate(mesh_vx.back()));

// Creating operators
SplineXEvaluator const spline_x_evaluator(bv_x_min, bv_x_max);
SplineVxEvaluator const spline_vx_evaluator(bv_vx_min, bv_vx_max);
#ifndef PERIODIC_RDIMX
SplineXEvaluator_1d const spline_x_evaluator_poisson(bv_x_min, bv_x_max);
#endif
PreallocatableSplineInterpolator const spline_x_interpolator(builder_x, spline_x_evaluator);

IdxStepVx static constexpr gwvx {0};
LagrangeInterpolator<GridVx, BCond::DIRICHLET, BCond::DIRICHLET, GridX, GridVx> const
lagrange_vx_non_preallocatable_interpolator(3, gwvx);
PreallocatableLagrangeInterpolator<
GridVx,
BCond::DIRICHLET,
BCond::DIRICHLET,
GridX,
GridVx> const lagrange_vx_interpolator(lagrange_vx_non_preallocatable_interpolator);
PreallocatableSplineInterpolator const spline_vx_interpolator(builder_vx, spline_vx_evaluator);

BslAdvectionSpatial<GeometryXVx, GridX> const advection_x(spline_x_interpolator);
BslAdvectionVelocity<GeometryXVx, GridVx> const advection_vx(lagrange_vx_interpolator);
BslAdvectionVelocity<GeometryXVx, GridVx> const advection_vx(spline_vx_interpolator);

// list of rhs operators
std::vector<std::reference_wrapper<IRightHandSide const>> rhs_operators;
Expand Down

0 comments on commit fd13344

Please sign in to comment.