Skip to content

Commit

Permalink
core: current best guess for what the intended RHS is for fibers...
Browse files Browse the repository at this point in the history
  • Loading branch information
blackwer committed Feb 2, 2023
1 parent 57d0a0d commit da33cf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
11 changes: 1 addition & 10 deletions src/core/fiber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,16 +233,7 @@ void Fiber::update_RHS(double dt, MatrixRef &flow, MatrixRef &f_external) {
// FIXME: Does this imply always having velocity boundary conditions?
xs_vT(bc_start_i + 3) = flow.col(minus_node).dot(xs_.col(minus_node));

RHS_ += vT_in - xs_vT;

RHS_.segment(0 * np, np) += flow.row(0);
RHS_.segment(1 * np, np) += flow.row(1);
RHS_.segment(2 * np, np) += flow.row(2);

RHS_.segment(3 * np, np) += (xs_x.transpose() * (flow.row(0) * D_1.matrix()).array() +
xs_y.transpose() * (flow.row(1) * D_1.matrix()).array() +
xs_z.transpose() * (flow.row(2) * D_1.matrix()).array())
.matrix();
RHS_ += -vT + vT_in - xs_vT;
}
if (f_external.size()) {
ArrayXXd fs = f_external * D_1;
Expand Down
3 changes: 2 additions & 1 deletion src/core/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,13 @@ void prep_state_for_solver() {
CVectorMap shell_velocities_flat(v_all.data() + 3 * fib_node_count, 3 * shell_node_count);
shell_->solution_vec_ = shell_->M_inv_ * shell_velocities_flat;
v_fibers_ = shell_->flow(fc_.get_local_node_positions(), shell_->solution_vec_, params_.eta);
v_fibers_ += v_all.block(0, 0, 3, fib_node_count);

MatrixXd external_force_fibers = MatrixXd::Zero(3, fib_node_count);
fc_.update_RHS(properties.dt, v_fibers_, external_force_fibers);
fc_.update_boundary_conditions(*shell_);
fc_.apply_bc_rectangular(properties.dt, v_fibers_, external_force_fibers);

v_fibers_ += v_all.block(0, 0, 3, fib_node_count);
}


Expand Down

0 comments on commit da33cf2

Please sign in to comment.