Skip to content
Snippets Groups Projects
Commit ee66e627 authored by wenqing's avatar wenqing
Browse files

[M] Avoid twice computing B

parent 2c6d3453
No related branches found
No related tags found
No related merge requests found
......@@ -164,12 +164,10 @@ public:
typename ConstitutiveRelations::ConstitutiveData<DisplacementDim>
updateConstitutiveRelations(
Eigen::Ref<Eigen::VectorXd const> const& u,
BMatrixType const& B, Eigen::Ref<Eigen::VectorXd const> const& u,
Eigen::Ref<Eigen::VectorXd const> const& u_prev,
ParameterLib::SpatialPosition const& x_position, double const t,
double const dt,
IntegrationPointData<BMatricesType, ShapeMatricesType, DisplacementDim>&
ip_data,
typename ConstitutiveRelations::ConstitutiveSetting<DisplacementDim>&
CS,
MaterialPropertyLib::Medium const& medium,
......@@ -179,21 +177,8 @@ public:
prev_state,
MaterialStateData<DisplacementDim>& material_state,
typename ConstitutiveRelations::OutputData<DisplacementDim>&
output_data,
BBarMatrixType const& B_dil_bar) const
output_data) const
{
auto const& N = ip_data.N_u;
auto const& dNdx = ip_data.dNdx_u;
auto const x_coord =
NumLib::interpolateXCoordinate<ShapeFunction, ShapeMatricesType>(
this->element_, N);
auto const B = LinearBMatrix::computeBMatrixPossiblyWithBbar<
DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType,
typename BMatricesType::BMatrixType>(dNdx, N, B_dil_bar, x_coord,
this->is_axially_symmetric_,
true /*use B bar*/);
double const T_ref =
this->process_data_.reference_temperature
? (*this->process_data_.reference_temperature)(t, x_position)[0]
......@@ -287,13 +272,12 @@ public:
DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType,
typename BMatricesType::BMatrixType>(
dNdx, N, B_dil_bar, x_coord, this->is_axially_symmetric_,
true /*use B bar*/);
this->process_data_.use_b_bar);
auto const CD = updateConstitutiveRelations(
u, u_prev, x_position, t, dt, _ip_data[ip],
constitutive_setting, medium, this->current_states_[ip],
this->prev_states_[ip], this->material_states_[ip],
this->output_data_[ip], B_dil_bar);
B, u, u_prev, x_position, t, dt, constitutive_setting, medium,
this->current_states_[ip], this->prev_states_[ip],
this->material_states_[ip], this->output_data_[ip]);
auto const& sigma = this->current_states_[ip].stress_data.sigma;
auto const& b = *CD.volumetric_body_force;
......@@ -327,12 +311,24 @@ public:
for (unsigned ip = 0; ip < n_integration_points; ip++)
{
x_position.setIntegrationPoint(ip);
auto const& N = _ip_data[ip].N_u;
auto const& dNdx = _ip_data[ip].dNdx_u;
auto const x_coord =
NumLib::interpolateXCoordinate<ShapeFunction,
ShapeMatricesType>(
this->element_, N);
auto const B = LinearBMatrix::computeBMatrixPossiblyWithBbar<
DisplacementDim, ShapeFunction::NPOINTS, BBarMatrixType,
typename BMatricesType::BMatrixType>(
dNdx, N, B_dil_bar, x_coord, this->is_axially_symmetric_,
this->process_data_.use_b_bar);
updateConstitutiveRelations(
local_x, local_x_prev, x_position, t, dt, _ip_data[ip],
B, local_x, local_x_prev, x_position, t, dt,
constitutive_setting, medium, this->current_states_[ip],
this->prev_states_[ip], this->material_states_[ip],
this->output_data_[ip], B_dil_bar);
this->output_data_[ip]);
this->material_states_[ip].pushBackState();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment