Commit 633cb931 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1443 Introduce a new template parameter to MoReFEMData to allow instances...

#1443 Introduce a new template parameter to MoReFEMData to allow instances without Parallelism block in the input data. There are also temporary blocks to track two step parallelism issue with boundary conditions.
parent 442520af
......@@ -501,8 +501,6 @@
BE35030A22F2E96700D09A4D /* Directory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE35030722F2E96700D09A4D /* Directory.cpp */; };
BE35030B22F2E96700D09A4D /* Directory.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE35030822F2E96700D09A4D /* Directory.hxx */; };
BE35030C22F2E96700D09A4D /* Directory.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE35030922F2E96700D09A4D /* Directory.hpp */; };
BE35031422F3503A00D09A4D /* PrepartitionedData.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE35031222F3503900D09A4D /* PrepartitionedData.hpp */; };
BE35031522F3503A00D09A4D /* PrepartitionedData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE35031322F3503A00D09A4D /* PrepartitionedData.cpp */; };
BE353B9A22E7527100A06A8F /* Extract.hxx in Headers */ = {isa = PBXBuildFile; fileRef = BE353B9722E7527100A06A8F /* Extract.hxx */; };
BE353B9B22E7527100A06A8F /* Extract.hpp in Headers */ = {isa = PBXBuildFile; fileRef = BE353B9822E7527100A06A8F /* Extract.hpp */; };
BE353B9F22E7539E00A06A8F /* Enum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE353B9C22E7539E00A06A8F /* Enum.cpp */; };
......@@ -3131,7 +3129,6 @@
BE1D448F225352A300911391 /* MacroVariationalOperator.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = MacroVariationalOperator.hpp; sourceTree = "<group>"; };
BE1D44932253575200911391 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE1D44A122555ADF00911391 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE1D44A222555ADF00911391 /* demo_input_data.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_input_data.lua; sourceTree = "<group>"; };
BE1D44A522560BEF00911391 /* Model.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Model.hpp; sourceTree = "<group>"; };
BE1D44A622560BEF00911391 /* Model.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Model.hxx; sourceTree = "<group>"; };
BE1D44A722560BEF00911391 /* Mpi.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Mpi.hpp; sourceTree = "<group>"; };
......@@ -3156,7 +3153,6 @@
BE2243EA20A2000C006AD11E /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE2433A81CD0E701008175D1 /* EnumTopology.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EnumTopology.cpp; sourceTree = "<group>"; };
BE2457AD1E005B2900677AEF /* InputData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InputData.hpp; sourceTree = "<group>"; };
BE2457AE1E005B2900677AEF /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
BE2592131C9ABA6900DF404B /* Utilities.doxygen */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Utilities.doxygen; sourceTree = "<group>"; };
BE25A7241CA2DC8E00984C5B /* Interfaces.doxygen */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Interfaces.doxygen; sourceTree = "<group>"; };
BE25DB831DB0DFF9003DA5C0 /* AtDof.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = AtDof.hxx; sourceTree = "<group>"; };
......@@ -3288,8 +3284,6 @@
BE35030F22F30E6E00D09A4D /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE35031022F30E8300D09A4D /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BE35031122F30FAA00D09A4D /* test.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = test.cpp; sourceTree = "<group>"; };
BE35031222F3503900D09A4D /* PrepartitionedData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = PrepartitionedData.hpp; sourceTree = "<group>"; };
BE35031322F3503A00D09A4D /* PrepartitionedData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PrepartitionedData.cpp; sourceTree = "<group>"; };
BE353B9722E7527100A06A8F /* Extract.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Extract.hxx; sourceTree = "<group>"; };
BE353B9822E7527100A06A8F /* Extract.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Extract.hpp; sourceTree = "<group>"; };
BE353B9C22E7539E00A06A8F /* Enum.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Enum.cpp; sourceTree = "<group>"; };
......@@ -4195,6 +4189,7 @@
BE8F0E631A81260600D81C9F /* ___FILEBASENAME___.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "___FILEBASENAME___.hpp"; sourceTree = "<group>"; };
BE8F0E641A81260600D81C9F /* ___FILEBASENAME___.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "___FILEBASENAME___.hxx"; sourceTree = "<group>"; };
BE8F0E651A81260600D81C9F /* TemplateInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = TemplateInfo.plist; sourceTree = "<group>"; };
BE8F4479248935EC00127711 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
BE901DC01CE31D0B0041C294 /* Miscellaneous.doxygen */ = {isa = PBXFileReference; explicitFileType = text.script.python; fileEncoding = 4; path = Miscellaneous.doxygen; sourceTree = "<group>"; };
BE9063391CABF05200E69200 /* InputData.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = InputData.hpp; sourceTree = "<group>"; };
BE90633A1CABF05200E69200 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
......@@ -4751,6 +4746,7 @@
BEF795D922DDBFCD0054B192 /* demo.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = demo.lua; sourceTree = "<group>"; };
BEF795DA22DDBFCD0054B192 /* Model.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Model.hxx; sourceTree = "<group>"; };
BEF795DD22DDDE430054B192 /* BinaryOrAscii.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = BinaryOrAscii.hpp; sourceTree = "<group>"; };
BEF8E7362487E0F500C3EE7A /* demo_rerun.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = demo_rerun.lua; sourceTree = "<group>"; };
BEF9835B180451CF00E7905D /* Factory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Factory.cpp; sourceTree = "<group>"; };
BEF9835C180451CF00E7905D /* Factory.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Factory.hpp; sourceTree = "<group>"; };
BEF9B613231EA647009A680D /* GetRankDirectory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GetRankDirectory.cpp; sourceTree = "<group>"; };
......@@ -5564,6 +5560,7 @@
isa = PBXGroup;
children = (
BE940F672481390D0095C5BB /* demo_initial.lua */,
BEF8E7362487E0F500C3EE7A /* demo_rerun.lua */,
BE0AFB7220750C570089FD9D /* CMakeLists.txt */,
BEB0C6171EC3054500D62905 /* README */,
BE6EA6201EC330820085E651 /* demo_input_hyperelasticity.lua */,
......@@ -6358,9 +6355,8 @@
children = (
BE1D44A122555ADF00911391 /* CMakeLists.txt */,
BEFC984E1F506C940025A424 /* README */,
BE1D44A222555ADF00911391 /* demo_input_data.lua */,
BEABE1DE1E014F730072318A /* demo_input_parameter_test_ipl.lua */,
BE2457AE1E005B2900677AEF /* main.cpp */,
BE8F4479248935EC00127711 /* main.cpp */,
BE2457AD1E005B2900677AEF /* InputData.hpp */,
);
path = InputData;
......@@ -7293,8 +7289,6 @@
BE4D0C9921A2E4F900E0D4E7 /* DirichletBoundaryCondition */,
BE4D0CF421A2E4F900E0D4E7 /* Result.cpp */,
BE4D0C9721A2E4F900E0D4E7 /* Result.hpp */,
BE35031322F3503A00D09A4D /* PrepartitionedData.cpp */,
BE35031222F3503900D09A4D /* PrepartitionedData.hpp */,
BE4D0CF521A2E4F900E0D4E7 /* InitialConditionGate.cpp */,
BE4D0C5A21A2E4F800E0D4E7 /* InitialConditionGate.hpp */,
BE4D0C9821A2E4F900E0D4E7 /* OutputDeformedMesh.hpp */,
......@@ -10909,7 +10903,6 @@
BE4D0D8021A2E4F900E0D4E7 /* Domain.hpp in Headers */,
BE4D0D4A21A2E4F900E0D4E7 /* RectangularSourceTimeParameter.hpp in Headers */,
BE4D0D7B21A2E4F900E0D4E7 /* LightweightDomainList.hpp in Headers */,
BE35031422F3503A00D09A4D /* PrepartitionedData.hpp in Headers */,
BE4D0D4221A2E4F900E0D4E7 /* SpatialFunction.hxx in Headers */,
BE7E555322EF507A00BEA053 /* Parallelism.hxx in Headers */,
BE4D0D3921A2E4F900E0D4E7 /* Petsc.hpp in Headers */,
......@@ -12621,7 +12614,6 @@
BE4D0D5721A2E4F900E0D4E7 /* C_i_Mu_i.cpp in Sources */,
BE4D0D6121A2E4F900E0D4E7 /* Kappa1.cpp in Sources */,
BE4D0D6721A2E4F900E0D4E7 /* Fluid.cpp in Sources */,
BE35031522F3503A00D09A4D /* PrepartitionedData.cpp in Sources */,
BE4D0D7021A2E4F900E0D4E7 /* ElectricalActivation.cpp in Sources */,
BE4D0D4721A2E4F900E0D4E7 /* RectangularSourceTimeParameter.cpp in Sources */,
BE4D0D5B21A2E4F900E0D4E7 /* Viscosity.cpp in Sources */,
......@@ -16,7 +16,7 @@ namespace MoReFEM::Advanced
{
//! Enum class which specifies the 4 possible behaviour related to parallelism.
//! Enum class which specifies the possible behaviour related to parallelism.
enum class parallelism_strategy
{
none,
......
......@@ -45,6 +45,11 @@ namespace MoReFEM
///@{
//! Whether there is a Parallelism block in MoReFEM input data.
enum class is_parallelism_field
{
no, yes
};
/*!
......@@ -60,6 +65,7 @@ namespace MoReFEM
* \tparam AdditionalCommandLineArgumentsPolicyT Policy if you need additional arguments on the command line.
* To see a concrete example of this possibility, have a look at Test/Core/MoReFEMData/test_command_line_options.cpp
* which demonstrate the possibility. If none, use std::false_type.
* \tparam IsParallelismFieldT Whether there is a Parallelism block in MoReFEM input data.
*
* http://tclap.sourceforge.net gives a nice manual of how to add additional argument on the command lines.
* By default, there is one mandatory argument (--input_data *lua file*) and one optional that might be
......@@ -69,6 +75,7 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT = is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT = Utilities::InputDataNS::DoTrackUnusedFields::yes,
class AdditionalCommandLineArgumentsPolicyT = std::false_type
>
......@@ -78,7 +85,14 @@ namespace MoReFEM
public:
//! Alias to self.
using self = MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>;
using self = MoReFEMData
<
InputDataT,
ProgramTypeT,
IsParallelismFieldT,
DoTrackUnusedFieldsT,
AdditionalCommandLineArgumentsPolicyT
>;
//! Alias to unique_ptr.
using const_unique_ptr = std::unique_ptr<self>;
......@@ -130,6 +144,10 @@ namespace MoReFEM
//! Accessor to the object which keeps the data related to parallelism strategy. Might be nullptr if none specified in the input lua file.
const Internal::Parallelism* GetParallelismPtr() const noexcept;
//! Whether there is a Parallelism block in MoReFEM input data.
//! \return True if there is one.
static constexpr bool IsParallelismField();
private:
//! Accessor to the object which keeps the data related to parallelism strategy.
......
......@@ -24,10 +24,27 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
constexpr bool
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::IsParallelismField()
{
return IsParallelismFieldT == is_parallelism_field::yes;
}
template
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::MoReFEMData(int argc, char** argv)
{
Internal::PetscNS::RAII::CreateOrGetInstance(__FILE__, __LINE__, argc, argv);
......@@ -125,10 +142,11 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::~MoReFEMData()
{
......@@ -160,11 +178,12 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
inline const Wrappers::Mpi&
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetMpi() const noexcept
{
decltype(auto) raii = Internal::PetscNS::RAII::GetInstance(__FILE__, __LINE__);
......@@ -176,11 +195,12 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const InputDataT&
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetInputData() const noexcept
{
assert(!(!input_data_));
......@@ -192,11 +212,12 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const FilesystemNS::Directory&
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetResultDirectory() const noexcept
{
assert(!(!result_directory_));
......@@ -208,11 +229,12 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const Internal::Parallelism*
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetParallelismPtr() const noexcept
{
if (!parallelism_)
......@@ -226,11 +248,12 @@ namespace MoReFEM
<
class InputDataT,
program_type ProgramTypeT,
is_parallelism_field IsParallelismFieldT,
Utilities::InputDataNS::DoTrackUnusedFields DoTrackUnusedFieldsT,
class AdditionalCommandLineArgumentsPolicyT
>
const Internal::Parallelism&
MoReFEMData<InputDataT, ProgramTypeT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
MoReFEMData<InputDataT, ProgramTypeT, IsParallelismFieldT, DoTrackUnusedFieldsT, AdditionalCommandLineArgumentsPolicyT>
::GetParallelism() const noexcept
{
assert(!(!parallelism_));
......@@ -256,14 +279,6 @@ namespace MoReFEM
throw ExceptionNS::GracefulExit(__FILE__, __LINE__);
}
case Advanced::parallelism_strategy::run_from_preprocessed:
// {
// if (morefem_data.GetMpi().IsRootProcessor())
// std::cout << "For dev purpose only: stop the program as we need to assess whether the model "
// "was built exactly like the original one."
// << std::endl;
//
// throw ExceptionNS::GracefulExit(__FILE__, __LINE__);
// }
case Advanced::parallelism_strategy::parallel:
case Advanced::parallelism_strategy::parallel_no_write:
break;
......
......@@ -29,18 +29,20 @@ namespace MoReFEM
{
CommonInit1(output_directory, std::move(a_felt_space_list));
const auto parallelism_ptr = morefem_data.GetParallelismPtr();
std::cout << "GOD OF DOF INIT!" << std::endl;
if (parallelism_ptr == nullptr)
if constexpr (!MoReFEMDataT::IsParallelismField())
{
assert(morefem_data.GetParallelismPtr() == nullptr);
std::cout << "\t Standard 1" << std::endl;
StandardInit(morefem_data,
do_consider_proc_wise_local_2_global);
}
else
{
const auto parallelism_ptr = morefem_data.GetParallelismPtr();
const auto parallelism_strategy = parallelism_ptr->GetParallelismStrategy();
switch(parallelism_strategy)
......@@ -59,10 +61,9 @@ namespace MoReFEM
case Advanced::parallelism_strategy::run_from_preprocessed:
{
std::cout << "\t FromPreprocessedInit 1" << std::endl;
// #1443 Silenced for the time being: I want first the tests to run properly before thinking of the better API
// (currently it would require a PrepartitionedData in all models, which would be overkill)
// FromPreprocessedInit(morefem_data,
// do_consider_proc_wise_local_2_global);
PreprocessInitHelper(morefem_data,
do_consider_proc_wise_local_2_global);
break;
}
......@@ -72,13 +73,12 @@ namespace MoReFEM
template<class MoReFEMDataT>
void GodOfDof::FullFromPreprocessedInit(const MoReFEMDataT& morefem_data,
FEltSpace::vector_unique_ptr&& felt_space_list,
DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global,
const FilesystemNS::Directory& output_directory)
void GodOfDof::PreprocessInitHelper(const MoReFEMDataT& morefem_data,
DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global)
{
static_cast<void>(do_consider_processor_wise_local_2_global);
CommonInit1(output_directory, std::move(felt_space_list));
#ifndef NDEBUG
do_consider_proc_wise_local_2_global_ = do_consider_processor_wise_local_2_global;
#endif // NDEBUG
namespace ipl = Utilities::InputDataNS;
......@@ -103,6 +103,20 @@ namespace MoReFEM
FromPreprocessedInit(god_of_dof_prepartitioned_data,
do_consider_processor_wise_local_2_global,
morefem_data.GetParallelismPtr());
}
template<class MoReFEMDataT>
void GodOfDof::FullFromPreprocessedInit(const MoReFEMDataT& morefem_data,
FEltSpace::vector_unique_ptr&& felt_space_list,
DoConsiderProcessorWiseLocal2Global do_consider_processor_wise_local_2_global,
const FilesystemNS::Directory& output_directory)
{
CommonInit1(output_directory, std::move(felt_space_list));
PreprocessInitHelper(morefem_data,
do_consider_processor_wise_local_2_global);
}
......
......@@ -107,8 +107,7 @@ namespace MoReFEM
const auto& node_bearers_in_current_local_felt_space =
local_felt_space.GetNodeBearerList();
decltype(auto) geometric_element = local_felt_space.GetGeometricElt();
assert(geometric_element.GetIndex() == geom_elt_index);
assert(local_felt_space.GetGeometricElt().GetIndex() == geom_elt_index);
for (const auto& node_bearer_ptr : node_bearers_in_current_local_felt_space)
{
......
......@@ -277,6 +277,10 @@ namespace MoReFEM
{
CommonInit1(output_directory, std::move(felt_space_list));
#ifndef NDEBUG
do_consider_proc_wise_local_2_global_ = do_consider_processor_wise_local_2_global;
#endif // NDEBUG
FromPreprocessedInit(god_of_dof_prepartitioned_data,
do_consider_processor_wise_local_2_global,
parallelism);
......
......@@ -40,6 +40,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -40,6 +40,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -27,6 +27,27 @@ namespace MoReFEM
void Model::SupplInitialize()
{
const auto& god_of_dof = GetGodOfDof(EnumUnderlyingType(MeshIndex::mesh));
// TMP #1443
{
decltype(auto) felt_space_list = god_of_dof.GetFEltSpaceList();
std::ostringstream oconv;
oconv << "SUMMARY FOR RANK " << GetMpi().GetRank<int>() << ": " << std::endl;
for (const auto& felt_space_ptr : felt_space_list)
{
oconv << "\tFor FEltSpace " << felt_space_ptr->GetUniqueId() << " Nproc = "
<< felt_space_ptr->GetProcessorWiseDofList().size() << " and Nghost = "
<< felt_space_ptr->GetGhostedDofList().size() << std::endl;
}
oconv << std::endl;
std::cout << oconv.str();
}
decltype(auto) morefem_data = parent::GetMoReFEMData();
const auto& felt_space_volume =
......
......@@ -273,6 +273,15 @@ namespace MoReFEM
void VariationalFormulation::ComputeResidual(const GlobalVector& evaluation_state,
GlobalVector& residual)
{
static int count = 0;
{
std::string output_file = std::string("/Volumes/Data/sebastien/Sandbox/Debug/eval_state_") + std::to_string(count);
evaluation_state.View(GetMpi(),
output_file,
__FILE__, __LINE__);
}
UpdateVectorsAndMatrices(evaluation_state);
switch(GetTimeManager().GetStaticOrDynamic())
......@@ -285,7 +294,23 @@ namespace MoReFEM
break;
}
{
std::string output_file = std::string("/Volumes/Data/sebastien/Sandbox/Debug/residual_before_bc_") + std::to_string(count);
residual.View(GetMpi(),
output_file,
__FILE__, __LINE__);
}
ApplyEssentialBoundaryCondition(residual);
{
std::string output_file = std::string("/Volumes/Data/sebastien/Sandbox/Debug/residual_after_bc_") + std::to_string(count);
residual.View(GetMpi(),
output_file,
__FILE__, __LINE__);
}
++count;
}
......@@ -343,6 +368,7 @@ namespace MoReFEM
{
static_cast<void>(evaluation_state);
static_cast<void>(preconditioner);
static int count = 0;
switch(GetTimeManager().GetStaticOrDynamic())
{
......@@ -353,8 +379,24 @@ namespace MoReFEM
ComputeDynamicTangent(tangent);
break;
}
{
std::string output_file = std::string("/Volumes/Data/sebastien/Sandbox/Debug/tangent_before_bc_") + std::to_string(count);
tangent.View(GetMpi(),
output_file,
__FILE__, __LINE__);
}
ApplyEssentialBoundaryCondition(tangent);
{
std::string output_file = std::string("/Volumes/Data/sebastien/Sandbox/Debug/tangent_after_bc_") + std::to_string(count);
tangent.View(GetMpi(),
output_file,
__FILE__, __LINE__);
}
++count;
}
......
......@@ -325,7 +325,8 @@ namespace MoReFEM
StiffnessOperatorType::const_unique_ptr stiffness_operator_ = nullptr;
//! Volumic source operator.
GlobalVariationalOperatorNS::TransientSource<ParameterNS::Type::vector>::const_unique_ptr surfacic_force_operator_ = nullptr;
GlobalVariationalOperatorNS::TransientSource<ParameterNS::Type::vector>::const_unique_ptr
surfacic_force_operator_ = nullptr;
///@}
......
......@@ -40,6 +40,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -40,6 +40,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -40,6 +40,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -41,6 +41,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -55,6 +55,7 @@ int main(int argc, char** argv)
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
......
......@@ -68,7 +68,13 @@ int main(int argc, char** argv)
using InputData = InputData<InputDataTuple>;
using morefem_data_type =
MoReFEMData<InputData, program_type::post_processing, Utilities::InputDataNS::DoTrackUnusedFields::no>;
MoReFEMData
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
>;
morefem_data_type morefem_data(argc, argv);
......
......@@ -73,6 +73,7 @@ BOOST_FIXTURE_TEST_CASE(cli_options, Fixture)
<
InputData,
program_type::test,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no,
NewArguments
>;
......
......@@ -35,7 +35,13 @@ int main(int argc, char** argv)
//! \copydoc doxygen_hide_model_specific_input_data
using InputData = TestNS::AnalyticalInternalVariable::InputData;
MoReFEMData<InputData, program_type::post_processing, Utilities::InputDataNS::DoTrackUnusedFields::no> morefem_data(argc, argv);
MoReFEMData
<
InputData,
program_type::post_processing,
is_parallelism_field::no,
Utilities::InputDataNS::DoTrackUnusedFields::no
> morefem_data(argc, argv);
const auto& input_data = morefem_data.GetInputData();