58 virtual std::optional<
Utils::Vector3d>
60 bool consider_points_in_halo = false) const = 0;
63 virtual std::vector<
Utils::Vector3d>
67 virtual std::optional<
double>
69 bool consider_points_in_halo = false) const = 0;
76 Utils::Vector3d const &force) = 0;
84 std::vector<
Utils::Vector3d> const &forces) = 0;
87 virtual std::optional<
Utils::Vector3d>
91 virtual std::optional<
Utils::Vector3d>
93 bool consider_ghosts = false) const = 0;
97 Utils::Vector3d const &force) = 0;
101 virtual std::vector<
double>
103 Utils::Vector3i const &upper_corner) const = 0;
109 Utils::Vector3i const &upper_corner,
110 std::vector<
double> const &force) = 0;
113 virtual std::optional<std::vector<
double>>
115 bool consider_ghosts = false) const = 0;
119 std::vector<
double> const &population) = 0;
122 virtual std::vector<
double>
124 Utils::Vector3i const &upper_corner) const = 0;
128 Utils::Vector3i const &upper_corner,
129 std::vector<
double> const &population) = 0;
132 virtual std::optional<
Utils::Vector3d>
134 bool consider_ghosts = false) const = 0;
138 Utils::Vector3d const &v) = 0;
141 virtual std::vector<
double>
143 Utils::Vector3i const &upper_corner) const = 0;
147 Utils::Vector3i const &upper_corner,
148 std::vector<
double> const &
velocity) = 0;
151 virtual std::optional<
double>
153 bool consider_ghosts = false) const = 0;
160 virtual std::vector<
double>
162 Utils::Vector3i const &upper_corner) const = 0;
166 Utils::Vector3i const &upper_corner,
167 std::vector<
double> const &
density) = 0;
170 virtual std::optional<
Utils::Vector3d>
172 bool consider_ghosts = false) const = 0;
180 virtual std::vector<std::optional<
Utils::Vector3d>>
182 Utils::Vector3i const &upper_corner) const = 0;
186 Utils::Vector3i const &lower_corner,
Utils::Vector3i const &upper_corner,
187 std::vector<std::optional<
Utils::Vector3d>> const &
velocity) = 0;
190 virtual std::optional<
Utils::Vector3d>
197 virtual std::optional<
bool>
199 bool consider_ghosts = false) const = 0;
202 virtual std::vector<
bool>
204 Utils::Vector3i const &upper_corner) const = 0;
214 std::vector<
double> const &) = 0;
225 unsigned int shear_plane_normal) const = 0;
228 virtual std::optional<
Utils::VectorXd<9>>
232 virtual std::vector<
double>
234 Utils::Vector3i const &upper_corner) const = 0;
258 virtual
double get_kT() const noexcept = 0;
261 virtual
unsigned int get_seed() const noexcept = 0;
275 [[nodiscard]] virtual
bool is_gpu() const noexcept = 0;
Vector implementation and trait types for boost qvm interoperability.
Interface of a lattice-based fluid model.
virtual bool remove_node_from_boundary(Utils::Vector3i const &node)=0
Remove a node from the boundaries.
virtual std::optional< Utils::Vector3d > get_node_velocity(Utils::Vector3i const &node, bool consider_ghosts=false) const =0
Get node velocity.
virtual bool set_node_last_applied_force(Utils::Vector3i const &node, Utils::Vector3d const &force)=0
Set stored force that was applied on node in the last time step.
virtual std::optional< Utils::Vector3d > get_node_velocity_at_boundary(Utils::Vector3i const &node, bool consider_ghosts=false) const =0
Get node velocity boundary conditions.
virtual bool add_force_at_pos(Utils::Vector3d const &position, Utils::Vector3d const &force)=0
Interpolate a force to the stored forces to be applied on nodes in the next time step.
virtual std::optional< Utils::Vector3d > get_node_last_applied_force(Utils::Vector3i const &node, bool consider_ghosts=false) const =0
Get stored force that was applied on node in the last time step.
virtual double get_density() const noexcept=0
Get the fluid density.
virtual std::optional< Utils::Vector3d > get_velocity_at_pos(Utils::Vector3d const &position, bool consider_points_in_halo=false) const =0
Get interpolated velocities at a position.
virtual Utils::VectorXd< 9 > get_pressure_tensor() const =0
Calculate average pressure tensor of the local domain.
virtual bool is_gpu() const noexcept=0
virtual std::optional< bool > get_node_is_boundary(Utils::Vector3i const &node, bool consider_ghosts=false) const =0
Check if node has velocity boundary conditions.
virtual std::optional< double > get_density_at_pos(Utils::Vector3d const &position, bool consider_points_in_halo=false) const =0
Get interpolated densities at a position.
virtual std::vector< double > get_slice_velocity(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Get slice velocity.
virtual void set_slice_velocity_at_boundary(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< std::optional< Utils::Vector3d > > const &velocity)=0
Set slice velocity boundary conditions.
virtual void clear_boundaries()=0
Clear the boundary flag field and the UBB field.
virtual std::optional< uint64_t > get_rng_state() const =0
Set the RNG counter (if thermalized).
virtual std::vector< double > get_slice_density(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Get slice density.
virtual std::size_t stencil_size() const noexcept=0
Number of discretized velocities in the PDF.
virtual void set_collision_model(double kT, unsigned int seed)=0
Configure the default collision model.
virtual bool set_node_velocity_at_boundary(Utils::Vector3i const &node, Utils::Vector3d const &velocity)=0
Set node velocity boundary conditions.
virtual Utils::Vector3d get_momentum() const =0
Calculate momentum of the local domain.
virtual bool is_double_precision() const noexcept=0
Whether kernels use double-precision floating point numbers.
virtual std::optional< double > get_node_density(Utils::Vector3i const &node, bool consider_ghosts=false) const =0
Get node density.
virtual std::size_t get_velocity_field_id() const noexcept=0
get the velocity field id
virtual std::vector< double > get_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Get slice population.
virtual void add_forces_at_pos(std::vector< Utils::Vector3d > const &positions, std::vector< Utils::Vector3d > const &forces)=0
Interpolate forces to the stored forces to be applied on nodes in the next time step.
virtual std::vector< std::optional< Utils::Vector3d > > get_slice_velocity_at_boundary(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Get slice velocity boundary conditions.
virtual std::optional< std::vector< double > > get_node_population(Utils::Vector3i const &node, bool consider_ghosts=false) const =0
Get node population.
virtual void reallocate_ubb_field()=0
Rebuild the UBB field.
virtual void set_slice_population(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &population)=0
Set slice population.
virtual std::optional< Utils::Vector3d > get_node_force_to_be_applied(Utils::Vector3i const &node) const =0
Get stored force to be applied on node in the next time step.
virtual bool set_node_population(Utils::Vector3i const &node, std::vector< double > const &population)=0
Set node population.
virtual unsigned int get_seed() const noexcept=0
Get the RNG seed (if thermalized).
virtual double get_kT() const noexcept=0
Get the fluid temperature (if thermalized).
virtual void set_rng_state(uint64_t counter)=0
Set the RNG counter (if thermalized).
virtual std::size_t get_force_field_id() const noexcept=0
get the force field id
virtual Utils::Vector3d get_external_force() const noexcept=0
Get the global external force.
virtual void update_boundary_from_shape(std::vector< int > const &, std::vector< double > const &)=0
Update boundary conditions from a rasterized shape.
virtual std::vector< double > get_slice_pressure_tensor(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Get slice pressure tensor.
virtual void set_slice_density(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &density)=0
Set slice density.
virtual void integrate()=0
Integrate LB for one time step.
virtual void set_viscosity(double viscosity)=0
Set the fluid viscosity.
virtual bool set_node_density(Utils::Vector3i const &node, double density)=0
Set node density.
virtual void check_lebc(unsigned int shear_direction, unsigned int shear_plane_normal) const =0
Check Lees-Edwards boundary conditions.
virtual void ghost_communication()=0
Perform ghost communication of PDF and applied forces.
virtual void set_external_force(Utils::Vector3d const &ext_force)=0
Set a global external force.
virtual void set_slice_velocity(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &velocity)=0
Set slice velocity.
virtual std::optional< Utils::Vector3d > get_node_boundary_force(Utils::Vector3i const &node) const =0
Get (stored) force applied on node due to boundary condition.
virtual std::vector< bool > get_slice_is_boundary(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Check if slice has velocity boundary conditions.
virtual bool set_node_velocity(Utils::Vector3i const &node, Utils::Vector3d const &v)=0
Set node velocity.
virtual double get_viscosity() const noexcept=0
Get the fluid viscosity.
virtual void set_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner, std::vector< double > const &force)=0
Set stored force that was applied on slice in the last time step.
virtual std::vector< Utils::Vector3d > get_velocities_at_pos(std::vector< Utils::Vector3d > const &pos)=0
Get interpolated velocities at positions.
virtual std::optional< Utils::VectorXd< 9 > > get_node_pressure_tensor(Utils::Vector3i const &node) const =0
Get node pressure tensor.
virtual std::vector< double > get_slice_last_applied_force(Utils::Vector3i const &lower_corner, Utils::Vector3i const &upper_corner) const =0
Get stored force that was applied on slice in the last time step.
~LBWalberlaBase() override=default
Abstract representation of a lattice-based model.
static Utils::Vector3d velocity(Particle const &p_ref, Particle const &p_vs)
Velocity of the virtual site.
Pack Lees-Edwards parameters for LB.