...
 
Commits (4)
......@@ -3,6 +3,9 @@ means week 46 of year 2013. Should a second tag be given the same week, an index
Starting from v18.47, the ticket numbers in bold are those that might break compatibility in models.
# v19.45.1
- Documentation #1497: Fix a tiny bug that prevented run of GitlabPages.
# v19.45
......@@ -34,7 +37,7 @@ Gitlab groups).
and the [Sonar scanner for C++ by the community](https://github.com/SonarOpenCommunity/sonar-cxx).
- Documentation #1495: Update README concerning CI
- _Standby_: Feature #1497: Add Verrou flaoting-point checks in CI. There is an issue to set it up properly for all VMs (current Docker image works
- _Standby_: Feature #1497: Add Verrou floating-point checks in CI. There is an issue to set it up properly for all VMs (current Docker image works
properly on only half the VMs of the project).
## Miscellaneous
......
......@@ -40,7 +40,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
......
......@@ -110,9 +110,7 @@ namespace MoReFEM
else
{
// Create it nonetheless - but will trigger an exception if the value is called.
MoReFEM::Internal::MoReFEMDataNS::CheckInvertedElements
::CreateOrGetInstance(__FILE__, __LINE__);
MoReFEM::Internal::MoReFEMDataNS::CheckInvertedElements::CreateOrGetInstance(__FILE__, __LINE__);
}
}
catch(const ExceptionNS::GracefulExit& e)
......
......@@ -114,7 +114,7 @@ namespace MoReFEM
const auto& mpi = GetMpi();
const auto rank = mpi.GetRank<unsigned int>();
// Create the nodes for all finite element spaces.
CreateNodeList();
......
......@@ -62,8 +62,6 @@ namespace MoReFEM
}
} // namespace MoReFEM
......
......@@ -134,48 +134,56 @@ namespace MoReFEM
{
static_cast<void>(snes);
static_cast<void>(a_residual); // a_residual is not used as its content mirror the one of system_rhs_.
// \a context_as_void is in fact the VariationalFormulation object.
assert(context_as_void);
VariationalFormulation* variational_formulation_ptr = static_cast<VariationalFormulation*>(context_as_void);
assert(!(!variational_formulation_ptr));
auto& variational_formulation = *variational_formulation_ptr;
#ifndef NDEBUG
const auto& displacement_numbering_subset = variational_formulation.GetDisplacementNumberingSubset();
{
std::string desc;
namespace Petsc = Wrappers::Petsc;
const bool is_same = Petsc::AreEqual(Petsc::Vector(a_residual, false),
variational_formulation.GetSystemRhs(displacement_numbering_subset),
1.e-12,
desc,
__FILE__, __LINE__);
if (!is_same)
{
std::cerr << "Bug in SNES implementation: third argument of snes function implemention is expected "
"to be the residual, which is born in VariationalFormulationT by the attribute RHS(). It is not the case "
"here.\n" << desc << std::endl;
variational_formulation.GetSystemRhs(displacement_numbering_subset).View(variational_formulation.GetMpi(), __FILE__, __LINE__);
try
{
// \a context_as_void is in fact the VariationalFormulation object.
assert(context_as_void);
assert(false);
}
}
#endif // NDEBUG
variational_formulation.UpdateVectorsAndMatrices(petsc_vec_displacement_at_newton_iteration);
variational_formulation.ComputeResidual();
return 0;
VariationalFormulation* variational_formulation_ptr = static_cast<VariationalFormulation*>(context_as_void);
assert(!(!variational_formulation_ptr));
auto& variational_formulation = *variational_formulation_ptr;
#ifndef NDEBUG
const auto& displacement_numbering_subset = variational_formulation.GetDisplacementNumberingSubset();
{
std::string desc;
namespace Petsc = Wrappers::Petsc;
const bool is_same = Petsc::AreEqual(Petsc::Vector(a_residual, false),
variational_formulation.GetSystemRhs(displacement_numbering_subset),
1.e-12,
desc,
__FILE__, __LINE__);
if (!is_same)
{
std::cerr << "Bug in SNES implementation: third argument of snes function implemention is expected "
"to be the residual, which is born in VariationalFormulationT by the attribute RHS(). It is not the case "
"here.\n" << desc << std::endl;
variational_formulation.GetSystemRhs(displacement_numbering_subset).View(variational_formulation.GetMpi(), __FILE__, __LINE__);
assert(false);
}
}
#endif // NDEBUG
variational_formulation.UpdateVectorsAndMatrices(petsc_vec_displacement_at_newton_iteration);
variational_formulation.ComputeResidual();
return EXIT_SUCCESS;
}
catch(const std::exception& e)
{
std::cerr << "Exception caught: " << e.what() << std::endl;
return EXIT_FAILURE;
}
}
......@@ -419,20 +427,29 @@ namespace MoReFEM
static_cast<void>(jacobian);
static_cast<void>(preconditioner);
static_cast<void>(evaluation_state);
// \a context_as_void is in fact the VariationalFormulation object.
assert(context_as_void);
VariationalFormulation* variational_formulation_ptr = static_cast<VariationalFormulation*>(context_as_void);
assert(!(!variational_formulation_ptr));
auto& variational_formulation = *variational_formulation_ptr;
variational_formulation.ComputeTangent();
return 0;
try
{
// \a context_as_void is in fact the VariationalFormulation object.
assert(context_as_void);
VariationalFormulation* variational_formulation_ptr = static_cast<VariationalFormulation*>(context_as_void);
assert(!(!variational_formulation_ptr));
auto& variational_formulation = *variational_formulation_ptr;
variational_formulation.ComputeTangent();
return EXIT_SUCCESS;
}
catch(const std::exception& e)
{
std::cerr << "Exception caught: " << e.what() << std::endl;
return EXIT_FAILURE;
}
}
void VariationalFormulation::ComputeTangent()
{
......@@ -493,35 +510,43 @@ namespace MoReFEM
{
static_cast<void>(snes);
assert(context_as_void);
const VariationalFormulation* variational_formulation_ptr =
static_cast<const VariationalFormulation*>(context_as_void);
assert(!(!variational_formulation_ptr));
const auto& variational_formulation = *variational_formulation_ptr;
const auto& displacement = variational_formulation.GetVectorDisplacementAtNewtonIteration();
const auto& velocity = variational_formulation.GetVectorVelocityAtNewtonIteration();
const PetscReal displacement_min = displacement.Min(__FILE__, __LINE__).second;
const PetscReal displacement_max = displacement.Max(__FILE__, __LINE__).second;
const PetscReal velocity_min = velocity.Min(__FILE__, __LINE__).second;
const PetscReal velocity_max = velocity.Max(__FILE__, __LINE__).second;
Wrappers::Petsc::PrintMessageOnFirstProcessor("%3D Residual norm: %1.12e Ymin: %8.6e Ymax: %8.6e Ypmin: %8.6e Ypmax: %8.6e\n",
variational_formulation.GetMpi(),
__FILE__, __LINE__,
its + 1,
norm,
displacement_min,
displacement_max,
velocity_min,
velocity_max
);
return 0;
try
{
const VariationalFormulation* variational_formulation_ptr =
static_cast<const VariationalFormulation*>(context_as_void);
assert(!(!variational_formulation_ptr));
const auto& variational_formulation = *variational_formulation_ptr;
const auto& displacement = variational_formulation.GetVectorDisplacementAtNewtonIteration();
const auto& velocity = variational_formulation.GetVectorVelocityAtNewtonIteration();
const PetscReal displacement_min = displacement.Min(__FILE__, __LINE__).second;
const PetscReal displacement_max = displacement.Max(__FILE__, __LINE__).second;
const PetscReal velocity_min = velocity.Min(__FILE__, __LINE__).second;
const PetscReal velocity_max = velocity.Max(__FILE__, __LINE__).second;
Wrappers::Petsc::PrintMessageOnFirstProcessor("%3D Residual norm: %1.12e Ymin: %8.6e Ymax: %8.6e Ypmin: %8.6e Ypmax: %8.6e\n",
variational_formulation.GetMpi(),
__FILE__, __LINE__,
its + 1,
norm,
displacement_min,
displacement_max,
velocity_min,
velocity_max
);
return EXIT_SUCCESS;
}
catch(const std::exception& e)
{
std::cerr << "Exception caught: " << e.what() << std::endl;
return EXIT_FAILURE;
}
}
void VariationalFormulation::PrepareDynamicRuns()
......
......@@ -36,16 +36,16 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS
const auto& elementary_data = GetElementaryData();
const auto& displacement_ref_felt = elementary_data.GetRefFElt(GetNthUnknown(0));
const int Nnode_displacement = static_cast<int>(displacement_ref_felt.Nnode());
const auto Nnode_displacement = displacement_ref_felt.Nnode();
const auto& pressure_ref_felt = elementary_data.GetRefFElt(GetNthUnknown(1));
const int Nnode_pressure = static_cast<int>(pressure_ref_felt.Nnode());
const auto Nnode_pressure = pressure_ref_felt.Nnode();
const auto& test_displacement_ref_felt = elementary_data.GetRefFElt(GetNthTestUnknown(0));
const int Nnode_test_displacement = static_cast<int>(test_displacement_ref_felt.Nnode());
const auto Nnode_test_displacement = test_displacement_ref_felt.Nnode();
const auto& test_pressure_ref_felt = elementary_data.GetRefFElt(GetNthTestUnknown(1));
const int Nnode_test_pressure = static_cast<int>(test_pressure_ref_felt.Nnode());
const auto Nnode_test_pressure = test_pressure_ref_felt.Nnode();
const unsigned int Ncomponent = elementary_data.GetGeomEltDimension();
const unsigned int square_Ncomponent = NumericNS::Square(Ncomponent);
......@@ -384,8 +384,8 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS
// Residual on disp
for (unsigned int row_component = 0u; row_component < Ncomponent; ++row_component)
{
const auto dof_first_index = static_cast<int>(test_displacement_ref_felt.GetIndexFirstDofInElementaryData(row_component));
const auto component_first_index = static_cast<int>(row_component * Ncomponent);
const auto dof_first_index = test_displacement_ref_felt.GetIndexFirstDofInElementaryData(row_component);
const auto component_first_index = row_component * Ncomponent;
// Compute the new contribution to vector_result here.
// Product matrix vector is inlined here to avoid creation of an intermediate subset of \a rhs_part.
......@@ -401,7 +401,7 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS
}
// Residual on pres
const auto dof_first_index_pres = static_cast<int>(Nnode_disp * Ncomponent);
const auto dof_first_index_pres = Nnode_disp * Ncomponent;
for (auto row_node = 0ul; row_node < Nnode_pressure; ++row_node)
{
vector_result(dof_first_index_pres + row_node) += rhs_pres * weight_meas * test_pressure_phi(row_node);
......@@ -458,11 +458,11 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS
// Tangent disp disp
for (unsigned int row_component = 0u; row_component < Ncomponent; ++row_component)
{
const auto row_first_index = static_cast<int>(test_displacement_ref_felt.GetIndexFirstDofInElementaryData(row_component));
const auto row_first_index = test_displacement_ref_felt.GetIndexFirstDofInElementaryData(row_component);
for (unsigned int col_component = 0u; col_component < Ncomponent; ++col_component)
{
const auto col_first_index = static_cast<int>(displacement_ref_felt.GetIndexFirstDofInElementaryData(col_component));
const auto col_first_index = displacement_ref_felt.GetIndexFirstDofInElementaryData(col_component);
Advanced::LocalVariationalOperatorNS::ExtractGradientBasedBlock(tangent_matrix_disp_disp,
row_component,
......@@ -487,12 +487,12 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS
// Tangent disp pres
const auto col_first_index_pressure = static_cast<int>(Ncomponent * Nnode_disp);
const auto row_first_index_pressure = static_cast<int>(Ncomponent * Nnode_test_disp);
const auto col_first_index_pressure = Ncomponent * Nnode_disp;
const auto row_first_index_pressure = Ncomponent * Nnode_test_disp;
for (unsigned int row_component = 0u; row_component < Ncomponent; ++row_component)
{
const auto row_first_index_disp = static_cast<int>(test_displacement_ref_felt.GetIndexFirstDofInElementaryData(row_component));
const auto row_first_index_disp = test_displacement_ref_felt.GetIndexFirstDofInElementaryData(row_component);
ExtractGradientBasedBlockColumnMatrix(tangent_vector_disp_pres,
row_component,
......@@ -522,7 +522,7 @@ namespace MoReFEM::Advanced::LocalVariationalOperatorNS
// Tangent pres disp
for (unsigned int col_component = 0u; col_component < Ncomponent; ++col_component)
{
const auto col_first_index_disp = static_cast<int>(displacement_ref_felt.GetIndexFirstDofInElementaryData(col_component));
const auto col_first_index_disp = displacement_ref_felt.GetIndexFirstDofInElementaryData(col_component);
ExtractGradientBasedBlockRowMatrix(tangent_vector_pres_disp,
col_component,
......
......@@ -144,7 +144,6 @@ namespace MoReFEM
const auto& geom_elt = elementary_data.GetCurrentGeomElt();
for (const auto& infos_at_quad_pt : infos_at_quad_pt_list)
{
tangent_matrix.fill(0.);
......
......@@ -207,7 +207,8 @@ namespace MoReFEM
error_code = SNESMonitorSet(snes_, GetSnesViewer(), context, PETSC_NULL);
if (error_code)
throw ExceptionNS::Exception(error_code, "SNESMonitorSet", invoking_file, invoking_line);
error_code = SNESSolve(snes_, nullptr, solution.Internal());
if (error_code)
throw ExceptionNS::Exception(error_code, "SNESSolve", invoking_file, invoking_line);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1100"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BE9CBB4F1B0B339100FA0F1B"
BuildableName = "libSeldon.a"
BlueprintName = "Seldon"
ReferencedContainer = "container:Seldon.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BE9CBB4F1B0B339100FA0F1B"
BuildableName = "libSeldon.a"
BlueprintName = "Seldon"
ReferencedContainer = "container:Seldon.xcodeproj">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "BE9CBB4F1B0B339100FA0F1B"
BuildableName = "libSeldon.a"
BlueprintName = "Seldon"
ReferencedContainer = "container:Seldon.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
......@@ -34,11 +34,9 @@ include(CheckIPOSupported)
cmake_policy(SET CMP0069 NEW) # Policy concerning IPO support
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
add_definitions(-DSELDON_CHECK_BOUNDS -DSELDON_CHECK_DIMENSIONS -DDEBUG=1)
add_definitions(-DDEBUG=1)
endif()
add_definitions(-DSELDON_WITH_LAPACK -DSELDON_WITH_BLAS -DSELDON_WITH_COMPILED_LIBRARY)
#add_cxx_compiler_flag("-fvisibility-inlines-hidden")
#add_cxx_compiler_flag("-fvisibility=default")
......