Commit 569542c5 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#838 Fix the compilation errors introduced when display value option was...

#838 Fix the compilation errors introduced when display value option was introduced stealthily in commit f1425bef.
parent 144f70ff
......@@ -517,7 +517,12 @@ Result = {
-- Directory in which all the results will be written.
-- Expected format: "VALUE"
output_directory = "/Volumes/Data/${USER}/HappyHeart/Results/Bidomain/Ventricles"
output_directory = "/Volumes/Data/${USER}/HappyHeart/Results/Bidomain/Ventricles",
-- Enables to skip some printing in the console. Can be used to WriteSolution every n time.
-- Expected format: VALUE
display_value = 1
} -- Result
......
......@@ -1495,7 +1495,12 @@ Result = {
-- Directory in which all the results will be written.
-- Expected format: "VALUE"
output_directory = "/Volumes/Data/${USER}/HappyHeart/Results/FSI_EI"
output_directory = "/Volumes/Data/${USER}/HappyHeart/Results/FSI_EI",
-- Enables to skip some printing in the console. Can be used to WriteSolution every n time.
-- Expected format: VALUE
display_value = 1
} -- Result
......
......@@ -96,29 +96,35 @@ namespace HappyHeart
{
assert(out.GetNumberingSubset() == rhs.GetNumberingSubset());
bool print_message = false;
if ((this->GetTimeManager().NtimeModified() % GetDisplayValue()) == 0)
print_message = true;
DoPrintMessage do_print_message =
(this->GetTimeManager().NtimeModified() % GetDisplayValue()) == 0
? DoPrintMessage::yes
: DoPrintMessage::no;
switch(IsFactorizedT)
{
case IsFactorized::no:
{
GetNonCstSnes().SolveLinear(matrix,
matrix,
rhs,
out,
print_message,
__FILE__, __LINE__);
__FILE__, __LINE__,
do_print_message);
break;
}
case IsFactorized::yes:
{
GetNonCstSnes().SolveLinear(rhs,
out,
print_message,
__FILE__, __LINE__);
__FILE__, __LINE__,
do_print_message);
break;
}
}
#ifndef NDEBUG
......
......@@ -91,8 +91,7 @@ namespace HappyHeart
template <ReactionLawNS::ReactionLawName ReactionLawNameT>
void BidomainModel<ReactionLawNameT>::SupplFinalize()
{
}
{ }
template <ReactionLawNS::ReactionLawName ReactionLawNameT>
......
......@@ -143,7 +143,7 @@ namespace HappyHeart
InputParameter::Petsc<EnumUnderlyingType(SolverIndex::solver)>,
InputParameter::Result::OutputDirectory,
InputParameter::Result,
InputParameter::Diffusion::Density,
InputParameter::Diffusion::Tensor<EnumUnderlyingType(TensorIndex::intracellular_trans_diffusion_tensor)>,
......
......@@ -196,7 +196,7 @@ namespace HappyHeart
InputParameter::FSI_EI_NS::Gamma,
InputParameter::Result::OutputDirectory
InputParameter::Result
>;
......
......@@ -280,8 +280,6 @@ namespace HappyHeart
ComputeDynamicMatrices();
const GodOfDof& god_of_dof = GetGodOfDof();
const GeometricMeshRegion& geometric_mesh_region = god_of_dof.GetGeometricMeshRegion();
{
const NumberingSubset& numbering_subset = GetNumberingSubset();
......
......@@ -81,16 +81,19 @@ namespace HappyHeart
spiral_source = 2
};
enum class TensorIndex
{
diffusion_tensor = 1
};
enum class InitialConditionIndex
{
potential_initial_condition = 1
};
enum class RectangularSourceTimeParameterIndex
{
horizontal_source = 1,
......
......@@ -212,8 +212,8 @@ namespace HappyHeart
void Snes::SolveLinear(const Vector& rhs,
Vector& solution,
bool print_message,
const char* invoking_file, int invoking_line)
const char* invoking_file, int invoking_line,
DoPrintMessage do_print_message)
{
KSP ksp = GetKsp(invoking_file, invoking_line);
......@@ -245,7 +245,7 @@ namespace HappyHeart
if (error_code)
throw ExceptionNS::Exception(error_code, "KSPGetResidualNorm", invoking_file, invoking_line);
if (print_message)
if (do_print_message == DoPrintMessage::yes)
{
PrintMessageOnFirstProcessor("%s-%s converged in %d iterations (residual = %e)\n",
GetMpi(),
......
......@@ -27,6 +27,9 @@
namespace HappyHeart
{
enum class DoPrintMessage { yes, no };
namespace Wrappers
......@@ -143,6 +146,7 @@ namespace HappyHeart
* \param[in] rhs Rhs.
* \param[in,out] solution It is expected the vector'structure is already correctly initialized
* in input.
* \param[in] do_print_message Whether some outputs are printed on screen or not.
* \param[in] invoking_file File that invoked the function or class; usually __FILE__.
* \param[in] invoking_line File that invoked the function or class; usually __LINE__.
*
......@@ -151,8 +155,8 @@ namespace HappyHeart
std::enable_if_t<std::is_base_of<Private::BaseMatrix, MatrixT>::value, void>
SolveLinear(const MatrixT& matrix, const MatrixT& preconditioner,
const Vector& rhs, Vector& solution,
bool print_message,
const char* invoking_file, int invoking_line);
const char* invoking_file, int invoking_line,
DoPrintMessage do_print_message = DoPrintMessage::yes);
/*!
......@@ -162,8 +166,9 @@ namespace HappyHeart
*/
void SolveLinear(const Vector& rhs,
Vector& solution,
bool print_message,
const char* invoking_file, int invoking_line);
const char* invoking_file, int invoking_line,
DoPrintMessage do_print_message = DoPrintMessage::yes);
/*!
* \brief Return the current iteration number (in Newton algorithm).
......
......@@ -64,8 +64,8 @@ namespace HappyHeart
const MatrixT& preconditioner,
const Vector& rhs,
Vector& solution,
bool print_message,
const char* invoking_file, int invoking_line)
const char* invoking_file, int invoking_line,
DoPrintMessage do_print_message)
{
KSP ksp = GetKsp(invoking_file, invoking_line);
......@@ -123,7 +123,7 @@ namespace HappyHeart
if (error_code)
throw ExceptionNS::Exception(error_code, "KSPGetResidualNorm", invoking_file, invoking_line);
if (print_message)
if (do_print_message == DoPrintMessage::yes)
{
PrintMessageOnFirstProcessor("%s-%s converged in %d iterations (residual = %e)\n",
GetMpi(),
......@@ -135,7 +135,7 @@ namespace HappyHeart
}
}
} // namespace Petsc
......
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