Commit 69d4c750 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#718 Hyperelasticity: remove unused function.

parent cee27b42
......@@ -154,7 +154,11 @@ namespace HappyHeart
__FILE__, __LINE__);
// Then update displacement.
vm.GetNonCstDisplacementPreviousTimeIteration().Copy(newest_displacement, __FILE__, __LINE__);
auto& displacement_prev_iteration = vm.GetNonCstDisplacementPreviousTimeIteration();
displacement_prev_iteration.Copy(newest_displacement, __FILE__, __LINE__);
displacement_prev_iteration.UpdateGhosts(__FILE__, __LINE__);
newest_displacement.template Print<MpiScale::processor_wise>(this->MpiHappyHeart(),
output_dir + "solid_displacement_prev_it.hhdata",
__FILE__, __LINE__);
......@@ -346,7 +350,7 @@ namespace HappyHeart
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
// vectors_and_matrices.GetMatrixStiffnessPreviousTimeIteration().View(this->MpiHappyHeart(), "/Users/sebastien/Desktop/current_stiffness.m",
// vectors_and_matrices.GetMatrixStiffnessPreviousTimeIteration().View(this->MpiHappyHeart(), "/Users/sebastien/Desktop/StiffnessPreviousTimeIteration.m",
// __FILE__, __LINE__,
// PETSC_VIEWER_ASCII_MATLAB);
}
......@@ -386,14 +390,7 @@ namespace HappyHeart
std::cout << "UPDATE VM" << std::endl;
auto& vm = this->GetNonCstVectorsAndMatrices();
{
// Zero all relevant matrices and vectors.
vm.GetNonCstMatrixNewStiffness().ZeroEntries(__FILE__, __LINE__);
vm.GetNonCstVectorNewStiffness().ZeroEntries(__FILE__, __LINE__);
HyperelasticityNS::Private::PreSnesTimeSchemeDependantZeroEntries(vm);
}
{
// Compute some matrices and vectors through arithmetical operations (e.g. vector for midpoint position).
const bool is_dynamic_iteration = true;
......@@ -403,7 +400,6 @@ namespace HappyHeart
{
// Update relevant ghosts.
vm.GetNonCstEvaluationState().UpdateGhosts(__FILE__, __LINE__);
vm.GetNonCstDisplacementPreviousTimeIteration().UpdateGhosts(__FILE__, __LINE__);
HyperelasticityNS::Private::PreSnesTimeSchemeDependantUpdateGhosts(vm);
}
......
......@@ -19,13 +19,7 @@ namespace HappyHeart
namespace Private
{
void PreSnesTimeSchemeDependantZeroEntries(VectorsAndMatrices<HyperelasticityNS::TimeScheme::half_sum>& vm)
{
static_cast<void>(vm);
}
void PreSnesTimeSchemeDependantUpdate(bool is_dynamic_iteration,
VectorsAndMatrices<HyperelasticityNS::TimeScheme::half_sum>& vm) noexcept
......
......@@ -29,18 +29,7 @@ namespace HappyHeart
{
/*!
* \brief Zero the relevant matrices and vectors prior to Snes solve.
*
* \param[in,out] vm Object including almost all matrices and vectors.
*
* \internal This function acts only on time scheme-dependant matrices and vectors; the
* others are already handled directly within VariationalFormulationHyperelasticity.
*/
void PreSnesTimeSchemeDependantZeroEntries(VectorsAndMatrices<HyperelasticityNS::TimeScheme::half_sum>& vm);
/*!
* \brief Update the relevant matrices and vectors prior to Snes solve.
*
......
......@@ -32,13 +32,19 @@ namespace HappyHeart
const Domain& domain)
{
std::cout << "ASSEMBLE STIFFNESS" << std::endl;
GlobalMatrixWithCoefficient mat(vm.GetNonCstMatrixNewStiffness(), is_static_call ? 1. : 0.5);
GlobalVectorWithCoefficient vec(vm.GetNonCstVectorNewStiffness(), 1.);
auto& matrix_stiffness = vm.GetNonCstMatrixNewStiffness();
auto& vector_stiffness = vm.GetNonCstVectorNewStiffness();
matrix_stiffness.ZeroEntries(__FILE__, __LINE__);
vector_stiffness.ZeroEntries(__FILE__, __LINE__);
GlobalMatrixWithCoefficient mat(matrix_stiffness, is_static_call ? 1. : 0.5);
GlobalVectorWithCoefficient vec(vector_stiffness, 1.);
the_operator.Assemble(std::make_tuple(std::ref(mat), std::ref(vec)),
vm.GetEvaluationState(),
domain);
}
......@@ -47,14 +53,14 @@ namespace HappyHeart
VectorsAndMatrices<HyperelasticityNS::TimeScheme::half_sum>& vm,
const Domain& domain)
{
auto& matrix_current_stiffness = vm.GetNonCstMatrixStiffnessPreviousTimeIteration();
auto& vector_current_stiffness = vm.GetNonCstVectorStiffnessPreviousTimeIteration();
auto& matrix_stiffness_previous_time_iteration = vm.GetNonCstMatrixStiffnessPreviousTimeIteration();
auto& vector_stiffness_previous_time_iteration = vm.GetNonCstVectorStiffnessPreviousTimeIteration();
matrix_current_stiffness.ZeroEntries(__FILE__, __LINE__);
vector_current_stiffness.ZeroEntries(__FILE__, __LINE__);
matrix_stiffness_previous_time_iteration.ZeroEntries(__FILE__, __LINE__);
vector_stiffness_previous_time_iteration.ZeroEntries(__FILE__, __LINE__);
GlobalMatrixWithCoefficient mat(matrix_current_stiffness, 0.5);
GlobalVectorWithCoefficient vec(vector_current_stiffness, 1.);
GlobalMatrixWithCoefficient mat(matrix_stiffness_previous_time_iteration, 0.5);
GlobalVectorWithCoefficient vec(vector_stiffness_previous_time_iteration, 1.);
the_operator.Assemble(std::make_tuple(std::ref(mat), std::ref(vec)),
vm.GetDisplacementPreviousTimeIteration(),
......
......@@ -20,12 +20,7 @@ namespace HappyHeart
namespace Private
{
void PreSnesTimeSchemeDependantZeroEntries(VectorsAndMatrices<HyperelasticityNS::TimeScheme::midpoint>& vm) noexcept
{
static_cast<void>(vm);
}
void PreSnesTimeSchemeDependantUpdate(bool is_dynamic_iteration,
VectorsAndMatrices<HyperelasticityNS::TimeScheme::midpoint>& vm)
......
......@@ -28,18 +28,7 @@ namespace HappyHeart
namespace Private
{
/*!
* \brief Zero the relevant matrices and vectors prior to Snes solve.
*
* \param[in,out] vm Object including almost all matrices and vectors.
*
* \internal This function acts only on time scheme-dependant matrices and vectors; the
* others are already handled directly within VariationalFormulationHyperelasticity.
*/
void PreSnesTimeSchemeDependantZeroEntries(VectorsAndMatrices<HyperelasticityNS::TimeScheme::midpoint>& vm) noexcept;
/*!
* \brief Update the relevant matrices and vectors prior to Snes solve.
......
......@@ -602,7 +602,6 @@ namespace HappyHeart
// Zero all relevant matrices and vectors.
vm.GetNonCstMatrixNewStiffness().ZeroEntries(__FILE__, __LINE__);
vm.GetNonCstVectorNewStiffness().ZeroEntries(__FILE__, __LINE__);
Private::PreSnesTimeSchemeDependantZeroEntries(vm);
}
......
Supports Markdown
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