47 if (
name ==
"set_velocity_at_boundary") {
49 m_lb_fluid->remove_node_from_boundary(m_index);
53 m_lb_fluid->set_node_velocity_at_boundary(m_index,
u);
55 m_lb_fluid->ghost_communication();
56 m_lb_fluid->reallocate_ubb_field();
59 if (
name ==
"get_velocity_at_boundary") {
60 auto const boundary_opt = m_lb_fluid->get_node_is_boundary(m_index);
62 auto const result = m_lb_fluid->get_node_velocity_at_boundary(m_index);
68 if (
name ==
"get_density") {
69 auto const result = m_lb_fluid->get_node_density(m_index);
73 if (
name ==
"set_density") {
75 m_lb_fluid->set_node_density(m_index,
dens * m_conv_dens);
76 m_lb_fluid->ghost_communication();
79 if (
name ==
"get_population") {
80 auto const result = m_lb_fluid->get_node_population(m_index);
83 if (
name ==
"set_population") {
85 m_lb_fluid->set_node_population(m_index,
pop);
86 m_lb_fluid->ghost_communication();
89 if (
name ==
"get_velocity") {
90 auto const result = m_lb_fluid->get_node_velocity(m_index);
94 if (
name ==
"set_velocity") {
97 m_lb_fluid->set_node_velocity(m_index,
u);
98 m_lb_fluid->ghost_communication();
101 if (
name ==
"get_is_boundary") {
102 auto const result = m_lb_fluid->get_node_is_boundary(m_index);
105 if (
name ==
"get_boundary_force") {
106 auto const boundary_opt = m_lb_fluid->get_node_is_boundary(m_index);
108 auto result = m_lb_fluid->get_node_boundary_force(m_index);
114 if (
name ==
"get_pressure_tensor" or name ==
"get_pressure_tensor_neq") {
115 auto const result = m_lb_fluid->get_node_pressure_tensor(m_index);
116 auto value = std::optional<std::vector<double>>{};
118 value = (*result / m_conv_press).as_vector();
121 if (
context()->is_head_node()) {
122 if (
name ==
"get_pressure_tensor_neq") {
124 auto const density = m_lb_fluid->get_density();
131 std::ranges::copy(
vec,
tensor.m_data.begin());
132 return std::vector<Variant>{
tensor.row<0>().as_vector(),
133 tensor.row<1>().as_vector(),
134 tensor.row<2>().as_vector()};
138 if (
name ==
"get_last_applied_force") {
139 auto const result = m_lb_fluid->get_node_last_applied_force(m_index);
143 if (
name ==
"set_last_applied_force") {
145 m_lb_fluid->set_node_last_applied_force(m_index, f * m_conv_force);
146 m_lb_fluid->ghost_communication();
149 if (
name ==
"get_lattice_speed") {
150 return 1. / m_conv_velocity;