97 for (
auto& bc : boundary_conditions_) {
99 int node_set_id = bc.node_set_id_;
100 int coordinate = bc.coordinate_;
101 bool has_expression = bc.has_expression_;
102 std::vector<int>
const& node_set = node_sets_[node_set_id];
103 if (!has_expression) {
104 double magnitude = bc.magnitude_;
105 for (
int n : node_set) {
106 velocity(n, coordinate) = magnitude;
107 for (
int nuq = 0; nuq < offnom_velocities.size(); nuq++) {
108 offnom_velocities[nuq](n, coordinate) = magnitude;
112 for (
int n : node_set) {
113 bc.expression_.x = reference_coordinates(n, 0);
114 bc.expression_.y = reference_coordinates(n, 1);
115 bc.expression_.z = 0.0;
116 if (dim_ == 3) { bc.expression_.z = reference_coordinates(n, 2); }
117 bc.expression_.t = 0.0;
118 velocity(n, coordinate) = bc.expression_.eval();
119 for (
int nuq = 0; nuq < offnom_velocities.size(); nuq++) {
120 offnom_velocities[nuq](n, coordinate) = bc.expression_.eval();
140 double time_previous,
141 const ViewT reference_coordinates,
144 std::vector<ViewT>& offnom_velocities)
146 double delta_t = time_current - time_previous;
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];
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;
163 displacement(n, coordinate) += velocity_magnitude * delta_t;
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;
179 displacement(n, coordinate) += velocity_magnitude * delta_t;
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; }
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; }
232 ApplyTractionBC(
double time_current,
const ViewT reference_coordinates, ViewT internal_force)
234 for (
auto& bc : boundary_conditions_) {
235 int side_set_id = bc.side_set_id_;
236 int coordinate = bc.coordinate_;
237 bool has_expression = bc.has_expression_;
238 std::vector<int>
const& side_set = side_sets_[side_set_id];
240 if (has_expression ==
true) {
241 for (
int ss : side_set) {}
243 for (
int ss : side_set) {}