24#ifdef ESPRESSO_WALBERLA
45#include <unordered_map>
54 if constexpr (std::is_same_v<T, VelocityBounceBackType>) {
55 std::vector<Variant>
vec;
65 }
else if constexpr (std::is_same_v<T, int>
or std::is_same_v<T, double>) {
75 if constexpr (std::is_same_v<T, VelocityBounceBackType>) {
79 values.emplace_back(std::nullopt);
84 }
else if constexpr (std::is_same_v<T, double>) {
89 values.emplace_back(
static_cast<double>(
val));
103 std::shared_ptr<LatticeModel> m_lb_fluid;
104 std::shared_ptr<LBFluid> m_lb_sip;
105 std::optional<ResourceObserver> m_mpi_cart_comm_observer;
109 double m_conv_velocity;
110 std::unordered_map<std::string, std::vector<int>> m_shape_val;
115 m_lb_fluid = m_lb_sip->get_lb_fluid();
116 m_mpi_cart_comm_observer = m_lb_sip->get_mpi_cart_comm_observer();
117 auto const lb_params = m_lb_sip->get_lb_params();
118 auto const tau = lb_params->get_tau();
119 auto const agrid = lb_params->get_agrid();
120 m_conv_dens = Utils::int_pow<3>(
agrid);
121 m_conv_press = Utils::int_pow<1>(
agrid) * Utils::int_pow<2>(tau);
122 m_conv_force = Utils::int_pow<2>(tau) / Utils::int_pow<1>(
agrid);
123 m_conv_velocity = Utils::int_pow<1>(tau) / Utils::int_pow<1>(
agrid);
129 m_shape_val[
"density"] = {1};
130 m_shape_val[
"population"] = {
static_cast<int>(m_lb_fluid->stencil_size())};
131 m_shape_val[
"velocity"] = {3};
132 m_shape_val[
"velocity_at_boundary"] = {1};
133 m_shape_val[
"is_boundary"] = {1};
134 m_shape_val[
"last_applied_force"] = {3};
135 m_shape_val[
"pressure_tensor"] = {3, 3};
136 m_shape_val[
"pressure_tensor_neq"] = {3, 3};
143 return m_lb_fluid->get_lattice();
LBWalberlaBase provides the public interface of the LB waLBerla bridge.
Vector implementation and trait types for boost qvm interoperability.
Interface of a lattice-based fluid model.
Class that runs and controls the BlockForest in waLBerla.
Type to indicate no value in Variant.
std::string_view name() const
::LatticeWalberla const & get_lattice() const override
Variant do_call_method(std::string const &name, VariantMap const ¶ms) override
void do_construct(VariantMap const ¶ms) override
Utils::Vector3i m_slice_upper_corner
Utils::Vector3i m_slice_lower_corner
std::vector< int > m_shape
std::optional< Utils::Vector3d > VelocityBounceBackType
constexpr bool is_none(Variant const &v)
constexpr bool is_type(Variant const &v)
Check is a Variant holds a specific type.
T get_value(Variant const &v)
Extract value of specific type T from a Variant.
std::unordered_map< std::string, Variant > VariantMap
auto make_vector_of_variants(std::vector< T > const &v)
Recursive variant implementation.
static Variant serialize(std::vector< T > const &values)
static std::vector< T > deserialize(Variant const &variant)