Commit 5d362874 authored by GILLES Sebastien's avatar GILLES Sebastien

#1421 Introduce the possibility to use MOREFEM_START_TIME in the output...

#1421 Introduce the possibility to use MOREFEM_START_TIME in the output directory given in the Lua file.
parent e7619f40
......@@ -4617,6 +4617,7 @@
BECEF92A22DF5D5E00D0DDE7 /* Now.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = Now.hpp; sourceTree = "<group>"; };
BECEF93322DF640900D0DDE7 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
BECEF93422DF640A00D0DDE7 /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
BECEF93522DF7B0200D0DDE7 /* demo_result_directory_start_time.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = demo_result_directory_start_time.lua; sourceTree = "<group>"; };
BED13351206519C700A3B0AA /* Penalization.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Penalization.hxx; sourceTree = "<group>"; };
BED13352206519C800A3B0AA /* Penalization.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Penalization.hpp; sourceTree = "<group>"; };
BED748E41906734200BAB761 /* main_test_ondomatic_numbering.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main_test_ondomatic_numbering.cpp; sourceTree = "<group>"; };
......@@ -5463,6 +5464,7 @@
BE0AFB7220750C570089FD9D /* CMakeLists.txt */,
BEB0C6171EC3054500D62905 /* README */,
BE6EA6201EC330820085E651 /* demo_input_hyperelasticity.lua */,
BECEF93522DF7B0200D0DDE7 /* demo_result_directory_start_time.lua */,
137F2B091E38B22900BD6083 /* InputData.hpp */,
137F2B0A1E38B22900BD6083 /* main.cpp */,
137F2B0B1E38B22900BD6083 /* main_ensight_output.cpp */,
......@@ -75,6 +75,10 @@
</CommandLineArgument>
<CommandLineArgument
argument = "-i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Hyperelasticity/demo_input_hyperelasticity.lua"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Hyperelasticity/demo_result_directory_start_time.lua"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
......
......@@ -64,6 +64,10 @@
<CommandLineArguments>
<CommandLineArgument
argument = "-i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Hyperelasticity/demo_input_hyperelasticity.lua"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-i ${HOME}/Codes/MoReFEM/CoreLibrary/Sources/ModelInstances/Hyperelasticity/demo_result_directory_start_time.lua"
isEnabled = "YES">
</CommandLineArgument>
</CommandLineArguments>
......
......@@ -27,6 +27,7 @@
# include "Utilities/TimeKeep/TimeKeep.hpp"
# include "Utilities/Environment/Environment.hpp"
# include "Utilities/OutputFormat/OutputFormat.hpp"
# include "Utilities/Datetime/Now.hpp"
# include "Core/InputData/Instances/Result.hpp"
# include "Core/InitTimeKeepLog.hpp"
......
......@@ -79,7 +79,6 @@ namespace MoReFEM
const auto& mpi = GetMpi();
// Set the MOREFEM_RESULT_DIR to default value if not yet settled.
{
const char* const result_dir = "MOREFEM_RESULT_DIR";
......@@ -111,6 +110,21 @@ namespace MoReFEM
"directory defined in input data file; if not it is in fact unused." << std::endl;
}
std::string start_time = "MOREFEM_START_TIME";
if (environment.DoExist(start_time))
{
throw Exception("There is an environment variable named 'MOREFEM_START_TIME'; please unset it before "
"running again your program (it might be set internally to determine the result "
"directory if ${MOREFEM_START_TIME} appears in the chosen path).",
__FILE__, __LINE__);
}
environment.SetEnvironmentVariable(std::make_pair(start_time, Utilities::Now(mpi)),
__FILE__, __LINE__);
mpi.Barrier();
}
......
......@@ -451,7 +451,7 @@ Result = {
-- MOREFEM_RESULT_DIR, which is either provided in user's environment or automatically set to
-- '/Volumes/Data/${USER}/MoReFEM/Results' in MoReFEM initialization step.
-- Expected format: "VALUE"
output_directory = "${MOREFEM_RESULT_DIR}/${MOREFEM_RUN_TIME}/MidpointHyperelasticity",
output_directory = "${MOREFEM_RESULT_DIR}/MidpointHyperelasticity",
-- Enables to skip some printing in the console. Can be used to WriteSolution every n time.
-- Expected format: VALUE
......
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