Commit 3cd28939 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 Call first solve operation in dH.

parent d85479ab
......@@ -183,6 +183,7 @@ namespace HappyHeart
* \todo #9 - #820 To complete!
*/
double PerformDifferential(unsigned int iteration,
const GlobalMatrix& monolithic_with_dirichlet,
const GlobalMatrix& monolithic_without_dirichlet);
......
......@@ -145,6 +145,7 @@ namespace HappyHeart
template<class HyperelasticLawT>
double VariationalFormulation<HyperelasticLawT>
::PerformDifferential(unsigned int iteration,
const GlobalMatrix& monolithic_with_dirichlet,
const GlobalMatrix& monolithic_without_dirichlet)
{
SetIndexInnerLoop(iteration);
......@@ -210,28 +211,71 @@ namespace HappyHeart
PETSC_VIEWER_ASCII_MATLAB);
}
auto& dirichlet_load_state_correction = GetNonCstDirichletLoadStateCorrection();
{
auto& dirichlet_load_state_correction = GetNonCstDirichletLoadStateCorrection();
// Matrix here is the one computed after the Newton loop was done, without the Dirichlet condition
// inside for T33 term.
Wrappers::Petsc::MatMult(monolithic_without_dirichlet,
robin_vector,
dirichlet_load_state_correction,
__FILE__, __LINE__);
{
const auto filename = parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(differential::yes)
+ "dirichletLoadStateCorrection_" + GetIterationTag() + ".m";
dirichlet_load_state_correction.View(parent::MpiHappyHeart(),
filename,
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
}
Wrappers::Petsc::AXPY(-1.,
GetDirichletLoadStateCorrection(),
rhs,
__FILE__, __LINE__);
// Matrix here is the one computed after the Newton loop was done, without the Dirichlet condition
// inside for T33 term.
Wrappers::Petsc::MatMult(monolithic_without_dirichlet,
robin_vector,
dirichlet_load_state_correction,
__FILE__, __LINE__);
{
const auto filename = parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(differential::yes)
+ "dirichletLoadStateCorrection_" + GetIterationTag() + ".m";
+ "imageMixtVariables_just_before_solve_" + GetIterationTag() + ".m";
dirichlet_load_state_correction.View(parent::MpiHappyHeart(),
filename,
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
rhs.View(parent::MpiHappyHeart(),
filename,
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
// \todo #820 Copy might be avoidable here.
parent::GetNonCstSystemMatrix(numbering_subset, numbering_subset).Copy(monolithic_with_dirichlet,
__FILE__, __LINE__);
parent::template SolveLinear<IsFactorized::no>(numbering_subset, numbering_subset);
{
const auto filename = parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(differential::yes)
+ "deltaMixtVariables_without_dirichletFunctionMixtVariables_" + GetIterationTag() + ".m";
parent::GetSystemSolution(numbering_subset).View(parent::MpiHappyHeart(),
filename,
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
// \todo #820 At the moment, I accept my norm is not the same as Bruno's; see what Petsc gives when
// SNES is applied (system_rhs's is what we got in hyperelastic model).
const double norm = parent::GetSystemRhs(numbering_subset).Norm(NORM_2, __FILE__, __LINE__);
......
......@@ -82,6 +82,7 @@ namespace HappyHeart
case differential::yes:
{
current_norm = inner_varf.PerformDifferential(counter++,
GetMonolithicMatrixAfterInnerLoop(),
GetMonolithicMatrixAfterInnerLoopWithoutDirichlet());
break;
}
......
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