49 if (
not name.starts_with(
"get_")) {
53 if (
name ==
"set_velocity_at_boundary") {
54 if (
is_none(params.at(
"value"))) {
55 m_lb_fluid->remove_node_from_boundary(m_index);
59 m_lb_fluid->set_node_velocity_at_boundary(m_index,
u);
61 m_lb_fluid->ghost_communication();
62 m_lb_fluid->reallocate_ubb_field();
65 if (
name ==
"get_velocity_at_boundary") {
66 auto const boundary_opt = m_lb_fluid->get_node_is_boundary(m_index);
68 auto const result = m_lb_fluid->get_node_velocity_at_boundary(m_index);
74 if (
name ==
"get_density") {
75 auto const result = m_lb_fluid->get_node_density(m_index);
79 if (
name ==
"set_density") {
81 m_lb_fluid->set_node_density(m_index,
dens * m_conv_dens);
82 m_lb_fluid->ghost_communication();
85 if (
name ==
"get_population") {
86 auto const result = m_lb_fluid->get_node_population(m_index);
89 if (
name ==
"set_population") {
91 m_lb_fluid->set_node_population(m_index,
pop);
92 m_lb_fluid->ghost_communication();
95 if (
name ==
"get_velocity") {
96 auto const result = m_lb_fluid->get_node_velocity(m_index);
100 if (
name ==
"set_velocity") {
103 m_lb_fluid->set_node_velocity(m_index,
u);
104 m_lb_fluid->ghost_communication();
107 if (
name ==
"get_is_boundary") {
108 auto const result = m_lb_fluid->get_node_is_boundary(m_index);
111 if (
name ==
"get_boundary_force") {
112 auto const boundary_opt = m_lb_fluid->get_node_is_boundary(m_index);
114 auto result = m_lb_fluid->get_node_boundary_force(m_index);
120 if (
name ==
"get_pressure_tensor" or name ==
"get_pressure_tensor_neq") {
121 auto const result = m_lb_fluid->get_node_pressure_tensor(m_index);
122 auto value = std::optional<std::vector<double>>{};
124 value = (*result / m_conv_press).as_vector();
127 if (
context()->is_head_node()) {
128 if (
name ==
"get_pressure_tensor_neq") {
130 auto const density = m_lb_fluid->get_density();
137 std::ranges::copy(
vec,
tensor.m_data.begin());
138 return std::vector<Variant>{
tensor.row<0>().as_vector(),
139 tensor.row<1>().as_vector(),
140 tensor.row<2>().as_vector()};
144 if (
name ==
"get_last_applied_force") {
145 auto const result = m_lb_fluid->get_node_last_applied_force(m_index);
149 if (
name ==
"set_last_applied_force") {
151 m_lb_fluid->set_node_last_applied_force(m_index, f * m_conv_force);
152 m_lb_fluid->ghost_communication();
155 if (
name ==
"get_lattice_speed") {
156 return 1. / m_conv_velocity;
virtual void parallel_try_catch(std::function< void()> const &cb) const =0