Commit 937321fe authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#531 Elasticity: use new interface for the operators that are already thus...

#531 Elasticity: use new interface for the operators that are already thus defined. Fix a miss in matrices and vectors allocation.
parent 7b041309
......@@ -70,13 +70,23 @@ namespace HappyHeart
{
const auto& numbering_subset = GetNumberingSubset();
auto& rhs = GetNonCstSystemRhs(numbering_subset);
auto time = GetTransientParameters().GetTime();
const auto time = GetTransientParameters().GetTime();
if (IsOperatorActivated<ForceIndexList::volumic_force>())
GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(1., rhs, time);
{
auto&& force_vector = GlobalVectorWithCoefficient(rhs, 1.);
GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(std::make_tuple(std::move(force_vector)),
time);
}
if (IsOperatorActivated<ForceIndexList::surfacic_force>())
GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(1., rhs, time);
{
auto&& force_vector = GlobalVectorWithCoefficient(rhs, 1.);
GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(std::make_tuple(std::move(force_vector)),
time);
}
GetNonCstStiffnessOperator().Assemble(1., GetNonCstSystemMatrix(numbering_subset, numbering_subset));
}
......@@ -85,9 +95,9 @@ namespace HappyHeart
void VariationalFormulationElasticity::AssembleDynamicCase()
{
const double mass_coefficient = 2. * GetVolumicMass() / Utilities::Square(GetTransientParameters().GetTimeStep());
GetNonCstMassPerSquareTimeStepOperator().Assemble(mass_coefficient,
GetNonCstMassPerSquareTime());
auto&& mass = GlobalMatrixWithCoefficient(GetNonCstMassPerSquareTime(), mass_coefficient);
GetNonCstMassPerSquareTimeStepOperator().Assemble(std::make_tuple(std::move(mass)));
}
......@@ -147,9 +157,8 @@ namespace HappyHeart
matrix_current_displacement_ = std::make_unique<GlobalMatrix>(system_matrix);
matrix_current_velocity_ = std::make_unique<GlobalMatrix>(system_matrix);
GetNonCstVectorCurrentVelocity().CompleteCopy(system_rhs, __FILE__, __LINE__);
GetNonCstVectorCurrentDisplacement().CompleteCopy(system_rhs, __FILE__, __LINE__);
vector_current_velocity_ = std::make_unique<GlobalVector>(system_rhs);
vector_current_displacement_ = std::make_unique<GlobalVector>(system_rhs);
}
......
......@@ -220,19 +220,6 @@ namespace HappyHeart
}
//
// auto& force_vector = vm.GetNonCstForce();
// auto time = transient_parameters.GetTime();
//
// if (this->template IsOperatorActivated<ForceIndexList::volumic_force>())
// this->template GetNonCstForceOperator<ForceIndexList::volumic_force>().Assemble(1.,
// force_vector,
// time);
//
// if (this->template IsOperatorActivated<ForceIndexList::surfacic_force>())
// this->template GetNonCstForceOperator<ForceIndexList::surfacic_force>().Assemble(1.,
// force_vector,
// time);
}
}
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment