145 {
146 double delta_t = time_current - time_previous;
147
148 for (auto& bc : boundary_conditions_) {
149 int node_set_id = bc.node_set_id_;
150 int coordinate = bc.coordinate_;
151 bool has_expression = bc.has_expression_;
152 std::vector<int> const& node_set = node_sets_[node_set_id];
153
155 if (!has_expression) {
156 double velocity_magnitude = bc.magnitude_;
157 for (int n : node_set) {
158 velocity(n, coordinate) = velocity_magnitude;
159 for (int nuq = 0; nuq < offnom_velocities.size(); nuq++) {
160 offnom_velocities[nuq](n, coordinate) = velocity_magnitude;
161 }
163 displacement(n, coordinate) += velocity_magnitude * delta_t;
164 }
165 }
166 } else {
167 for (int n : node_set) {
168 bc.expression_.x = reference_coordinates(n, 0);
169 bc.expression_.y = reference_coordinates(n, 1);
170 bc.expression_.z = 0.0;
171 if (dim_ == 3) { bc.expression_.z = reference_coordinates(n, 2); }
172 bc.expression_.t = time_current;
173 double velocity_magnitude = bc.expression_.eval();
174 velocity(n, coordinate) = velocity_magnitude;
175 for (int nuq = 0; nuq < offnom_velocities.size(); nuq++) {
176 offnom_velocities[nuq](n, coordinate) = velocity_magnitude;
177 }
179 displacement(n, coordinate) += velocity_magnitude * delta_t;
180 }
181 }
182 }
184 if (!has_expression) {
185 double displacement_magnitude = bc.magnitude_;
186 for (int n : node_set) {
187 velocity(n, coordinate) = (displacement_magnitude - displacement(n, coordinate)) / delta_t;
188 if (time_integration_scheme_ ==
QUASISTATIC) { displacement(n, coordinate) = displacement_magnitude; }
189 }
190 } else {
191 for (int n : node_set) {
192 bc.expression_.x = reference_coordinates(n, 0);
193 bc.expression_.y = reference_coordinates(n, 1);
194 bc.expression_.z = 0.0;
195 if (dim_ == 3) { bc.expression_.z = reference_coordinates(n, 2); }
196 bc.expression_.t = time_current;
197 double displacement_magnitude = bc.expression_.eval();
198 velocity(n, coordinate) = (displacement_magnitude - displacement(n, coordinate)) / delta_t;
199 if (time_integration_scheme_ ==
QUASISTATIC) { displacement(n, coordinate) = displacement_magnitude; }
200 }
201 }
202 }
203 }
204 }
@ PRESCRIBED_VELOCITY
Definition nimble_boundary_condition.h:66
@ PRESCRIBED_DISPLACEMENT
Definition nimble_boundary_condition.h:67