Commit ca4bd484 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 Start fine tuning what is and is not done in differentical call.

parent 22a3b67f
......@@ -68,37 +68,50 @@ namespace HappyHeart
corrected_values.UpdateGhosts(__FILE__, __LINE__);
}
auto& system_matrix = parent::GetNonCstSystemMatrix(numbering_subset, numbering_subset);
system_matrix.ZeroEntries(__FILE__, __LINE__);
switch(is_differential)
{
case differential::no:
{
auto& system_matrix = parent::GetNonCstSystemMatrix(numbering_subset, numbering_subset);
system_matrix.ZeroEntries(__FILE__, __LINE__);
ComputeMatrix(do_reuse_matrix, BlocksToRecompute::all);
system_matrix.Assembly(__FILE__, __LINE__);
system_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "full_matrix_" + GetIterationTag() + ".hhdata",
__FILE__, __LINE__);
system_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "full_matrix_" + GetIterationTag() + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
system_matrix.ViewBinary(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "full_matrix_" + GetIterationTag() + ".binary.hhdata",
__FILE__, __LINE__);
break;
}
case differential::yes:
// Just reuse tangent matrix computed at the end of last non differential case.
break;
} // switch
ComputeMatrix(do_reuse_matrix, BlocksToRecompute::all);
ComputeRhs(is_differential); // must occur after T11, as it needs the t11 matrix.
system_matrix.Assembly(__FILE__, __LINE__);
system_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "full_matrix_" + GetIterationTag() + ".hhdata",
__FILE__, __LINE__);
system_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "full_matrix_" + GetIterationTag() + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
system_matrix.ViewBinary(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "full_matrix_" + GetIterationTag() + ".binary.hhdata",
__FILE__, __LINE__);
parent::template SolveLinear<IsFactorized::no>(numbering_subset, numbering_subset);
......
......@@ -76,61 +76,64 @@ namespace HappyHeart
std::cout << "Norm after inner loop = " << current_norm << std::endl;
} while (current_norm > 1.e-12 && counter < 10u); // \todo #820 Replace by proper stop condition from input file!
// Update fluidmass, velocity fluid and pressure.
Wrappers::Petsc::MatMult(inner_varf.GetMonolithic2Mass().GetInterpolationMatrix(),
inner_varf.GetCorrectedValues(),
variable_holder_parent::GetNonCstVariableHolder().GetNonCstFluidMassVector(),
__FILE__, __LINE__);
// Perform one more time to update T21, T33 and T33 without Dirichlet.
if (is_differential == differential::no)
{
decltype(auto) updated_matrix = inner_varf.ComputeMatrixWithUpdatedT21();
// Update fluidmass, velocity fluid and pressure.
Wrappers::Petsc::MatMult(inner_varf.GetMonolithic2Mass().GetInterpolationMatrix(),
inner_varf.GetCorrectedValues(),
variable_holder_parent::GetNonCstVariableHolder().GetNonCstFluidMassVector(),
__FILE__, __LINE__);
// \todo #820 - #530 Use Swap when available!
GetNonCstMonolithicMatrixAfterInnerLoop().Copy(updated_matrix, __FILE__, __LINE__);
// Perform one more time to update T21, T33 and T33 without Dirichlet.
{
decltype(auto) updated_matrix = inner_varf.ComputeMatrixWithUpdatedT21();
// \todo #820 - #530 Use Swap when available!
GetNonCstMonolithicMatrixAfterInnerLoop().Copy(updated_matrix, __FILE__, __LINE__);
updated_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "matrix_after_FP_mixt_with_dirichlet_time_"
+ std::to_string(parent::GetTimeManager().NtimeModified()) + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
updated_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "matrix_after_FP_mixt_with_dirichlet_time_"
+ std::to_string(parent::GetTimeManager().NtimeModified()) + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
{
// \todo #820 - #530 Use Swap when available!
decltype(auto) updated_matrix = inner_varf.ComputeMatrixWithUpdatedT33WithoutDirichlet();
GetNonCstMonolithicMatrixAfterInnerLoopWithoutDirichlet().Copy(updated_matrix, __FILE__, __LINE__);
// \todo #820 Not exactly equal to Freefem; investigate if one term is missing!
updated_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "matrix_after_FP_mixt_without_dirichlet_time_"
+ std::to_string(parent::GetTimeManager().NtimeModified()) + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
{
decltype(auto) darcy_vector = GetNonCstDarcyVector();
{
// \todo #820 - #530 Use Swap when available!
decltype(auto) updated_matrix = inner_varf.ComputeMatrixWithUpdatedT33WithoutDirichlet();
GetNonCstMonolithicMatrixAfterInnerLoopWithoutDirichlet().Copy(updated_matrix, __FILE__, __LINE__);
// \todo #820 Not exactly equal to Freefem; investigate if one term is missing!
updated_matrix.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "matrix_after_FP_mixt_without_dirichlet_time_"
+ std::to_string(parent::GetTimeManager().NtimeModified()) + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
inner_varf.ComputeDarcy(-1., IsFullDarcy::no, darcy_vector);
darcy_vector.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "darcy_vector_after_FP_mixt_time_"
+ std::to_string(parent::GetTimeManager().NtimeModified()) + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
{
decltype(auto) darcy_vector = GetNonCstDarcyVector();
inner_varf.ComputeDarcy(-1., IsFullDarcy::no, darcy_vector);
darcy_vector.View(parent::MpiHappyHeart(),
parent::GetOutputDirectory(numbering_subset)
+ "/"
+ DifferentialPreffix(is_differential)
+ "darcy_vector_after_FP_mixt_time_"
+ std::to_string(parent::GetTimeManager().NtimeModified()) + ".m",
__FILE__, __LINE__,
PETSC_VIEWER_ASCII_MATLAB);
}
}
}
......
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