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
......
-- Comment lines are introduced by "--".
-- In a section (i.e. within braces), all entries must be separated by a comma.
transient = {
-- Time at the beginning of the code (in seconds).
-- Expected format: VALUE
-- Constraint: v >= 0.
init_time = 0.,
-- Time step between two iterations, in seconds.
-- Expected format: VALUE
-- Constraint: v > 0.
timeStep = 0.1,
-- Maximum time, if set to zero run a static case.
-- Expected format: VALUE
-- Constraint: v >= 0.
timeMax = 2.
} -- transient
NumberingSubset1 = {
-- Name of the numbering subset (not really used; at the moment I just need one input parameter to ground
-- the possible values to choose elsewhere).
-- Expected format: "VALUE"
name = "displacement",
-- Whether a vector defined on this numbering subset might be used to compute a movemesh. If true, a
-- FEltSpace featuring this numbering subset will compute additional quantities to enable fast computation.
-- This should be false for most numbering subsets, and when it's true the sole unknown involved should be a
-- displacement.
-- Expected format: 'true' or 'false' (without the quote)
do_move_mesh = false
} -- NumberingSubset1
Unknown1 = {
-- Name of the unknown (used for displays in output).
-- Expected format: "VALUE"
name = "displacement",
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'scalar', 'vectorial'})
nature = "vectorial"
} -- Unknown1
Mesh1 = {
-- Path of the mesh file to use.
-- Expected format: "VALUE"
mesh = "${MOREFEM_ROOT}/Data/Mesh/Bar.mesh",
-- Format of the input mesh.
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'Ensight', 'Medit'})
format = "Medit",
-- Highest dimension of the input mesh. This dimension might be lower than the one effectively read in the
-- mesh file; in which case Coords will be reduced provided all the dropped values are 0. If not, an
-- exception is thrown.
-- Expected format: VALUE
-- Constraint: v <= 3 and v > 0
dimension = 3,
-- Space unit of the mesh.
-- Expected format: VALUE
space_unit = 1.
} -- Mesh1
-- Domain1 - Full mesh.
Domain1 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh; at most one value is expected here.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: value_in(v, {0, 1, 2, 3})
dimension_list = { },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these. No constraint is applied at LuaOptionFile level, as some geometric element types could be added after
-- generation of current input data file. Current list is below; if an incorrect value is put there it
-- will be detected a bit later when the domain object is built.
-- The known types when this file was generated are:
-- . Point1
-- . Segment2, Segment3
-- . Triangle3, Triangle6
-- . Quadrangle4, Quadrangle8, Quadrangle9
-- . Tetrahedron4, Tetrahedron10
-- . Hexahedron8, Hexahedron20, Hexahedron27.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
} -- Domain1
-- Domain2 - The 3D elements of the mesh.
Domain2 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh; at most one value is expected here.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: value_in(v, {0, 1, 2, 3})
dimension_list = { 3 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these. No constraint is applied at LuaOptionFile level, as some geometric element types could be added after
-- generation of current input data file. Current list is below; if an incorrect value is put there it
-- will be detected a bit later when the domain object is built.
-- The known types when this file was generated are:
-- . Point1
-- . Segment2, Segment3
-- . Triangle3, Triangle6
-- . Quadrangle4, Quadrangle8, Quadrangle9
-- . Tetrahedron4, Tetrahedron10
-- . Hexahedron8, Hexahedron20, Hexahedron27.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
} -- Domain2
-- Domain3 - The border upon which surfacic forces are applied.
Domain3 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh; at most one value is expected here.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: value_in(v, {0, 1, 2, 3})
dimension_list = { 2 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { 2 },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these. No constraint is applied at LuaOptionFile level, as some geometric element types could be added after
-- generation of current input data file. Current list is below; if an incorrect value is put there it
-- will be detected a bit later when the domain object is built.
-- The known types when this file was generated are:
-- . Point1
-- . Segment2, Segment3
-- . Triangle3, Triangle6
-- . Quadrangle4, Quadrangle8, Quadrangle9
-- . Tetrahedron4, Tetrahedron10
-- . Hexahedron8, Hexahedron20, Hexahedron27.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
} -- Domain3
-- Domain4 - upon which Dirichlet boundary condition is applied.
Domain4 = {
-- Index of the geometric mesh upon which the domain is defined (as defined in the present file). Might be
-- left empty if domain not limited to one mesh; at most one value is expected here.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_index = { 1 },
-- List of dimensions encompassed by the domain. Might be left empty if no restriction at all upon
-- dimensions.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: value_in(v, {0, 1, 2, 3})
dimension_list = { 2 },
-- List of mesh labels encompassed by the domain. Might be left empty if no restriction at all upon mesh
-- labels. This parameter does not make sense if no mesh is defined for the domain.
-- Expected format: {VALUE1, VALUE2, ...}
mesh_label_list = { 1 },
-- List of geometric element types considered in the domain. Might be left empty if no restriction upon
-- these. No constraint is applied at LuaOptionFile level, as some geometric element types could be added after
-- generation of current input data file. Current list is below; if an incorrect value is put there it
-- will be detected a bit later when the domain object is built.
-- The known types when this file was generated are:
-- . Point1
-- . Segment2, Segment3
-- . Triangle3, Triangle6
-- . Quadrangle4, Quadrangle8, Quadrangle9
-- . Tetrahedron4, Tetrahedron10
-- . Hexahedron8, Hexahedron20, Hexahedron27.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
} -- Domain4
EssentialBoundaryCondition1 = {
-- Name of the boundary condition (must be unique).
-- Expected format: "VALUE"
name = "clamped",
-- Comp1, Comp2 or Comp3
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'Comp1', 'Comp2', 'Comp3', 'Comp12', 'Comp23', 'Comp13', 'Comp123'})
component = 'Comp123',
-- Name of the unknown addressed by the boundary condition.
-- Expected format: "VALUE"
unknown = 'displacement',
-- Values at each of the relevant component.
-- Expected format: {VALUE1, VALUE2, ...}
value = { 0., 0., 0. },
-- Index of the domain onto which essential boundary condition is defined.
-- Expected format: VALUE
domain_index = 4,
-- Whether the values of the boundary condition may vary over time.
-- Expected format: 'true' or 'false' (without the quote)
is_mutable = false,
-- Whether a dof of this boundary condition may also belong to another one. This highlights an ill-defined
-- model in most cases, but I nonetheless need it for FSI/ALE.
-- Expected format: 'true' or 'false' (without the quote)
may_overlap = false
} -- EssentialBoundaryCondition1
-- Volume
FiniteElementSpace1 = {
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: VALUE
god_of_dof_index = 1,
-- Index of the domain onto which the finite element space is defined. This domain must be unidimensional.
-- Expected format: VALUE
domain_index = 2,
-- List of all unknowns defined in the finite element space. Unknowns here must be defined in this file as
-- an 'Unknown' block; expected name/identifier is the name given there.
-- Expected format: {"VALUE1", "VALUE2", ...}
unknown_list = { "displacement" },
-- List of the shape function to use for each unknown;
-- Expected format: {"VALUE1", "VALUE2", ...}
shape_function_list = { "P1" },
-- List of the numbering subset to use for each unknown;
-- Expected format: {VALUE1, VALUE2, ...}
numbering_subset_list = { 1 }
} -- FiniteElementSpace1
-- Surfacic
FiniteElementSpace2 = {
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: VALUE
god_of_dof_index = 1,
-- Index of the domain onto which the finite element space is defined. This domain must be unidimensional.
-- Expected format: VALUE
domain_index = 3,
-- List of all unknowns defined in the finite element space. Unknowns here must be defined in this file as
-- an 'Unknown' block; expected name/identifier is the name given there.
-- Expected format: {"VALUE1", "VALUE2", ...}
unknown_list = { "displacement" },
-- List of the shape function to use for each unknown;
-- Expected format: {"VALUE1", "VALUE2", ...}
shape_function_list = { "P1" },
-- List of the numbering subset to use for each unknown;
-- Expected format: {VALUE1, VALUE2, ...}
numbering_subset_list = { 1 }
} -- FiniteElementSpace2
Petsc1 = {
-- Absolute tolerance
-- Expected format: VALUE
-- Constraint: v > 0.
absoluteTolerance = 1e-8,
-- gmresStart
-- Expected format: VALUE
-- Constraint: v >= 0
gmresRestart = 200,
-- Maximum iteration
-- Expected format: VALUE
-- Constraint: v > 0
maxIteration = 1000,
-- Preconditioner to use. Must be lu for any direct solver.
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'lu', 'none'})
preconditioner = 'lu',
-- Relative tolerance
-- Expected format: VALUE
-- Constraint: v > 0.
relativeTolerance = 1e-5,
-- Step size tolerance
-- Expected format: VALUE
-- Constraint: v > 0.
stepSizeTolerance = 1e-8,
-- Solver to use.
-- Expected format: "VALUE"
-- Constraint: value_in(v, { 'Mumps', 'Umfpack', 'Gmres' })
solver = 'Mumps'
} -- Petsc1
-- Surfacic
TransientSource1 = {
-- How is given the transient source value (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function'})
nature = { 'constant', 'constant', 'constant'},
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
value = { 0., 300., 0. }
} -- TransientSource1
Solid = {
VolumicMass = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','at_quadrature_point','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
value = 1.
}, -- VolumicMass
HyperelasticBulk = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','at_quadrature_point','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
value = 1750000.
}, -- HyperelasticBulk
Kappa1 = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','at_quadrature_point','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
value = 500.
}, -- Kappa1
Kappa2 = {
-- How is given the parameter (as a constant, as a Lua function, per quadrature point, etc...). Choose
-- "ignore" if you do not want this parameter (in this case it will stay at nullptr).
-- Expected format: "VALUE"
-- Constraint: value_in(v, {'ignore', 'constant', 'lua_function','at_quadrature_point','piecewise_constant_by_domain'})
nature = "constant",
-- The value for the parameter, which type depends directly on the nature chosen:
-- If nature is 'constant', expected format is VALUE
-- If nature is 'piecewise_constant_by_domain', expected format is {[KEY1] = VALUE1, [KEY2] = VALUE2, ...}
-- If nature is 'lua_function', expected format is a Lua function with prototype function(x, y, z)
-- return x + y - z
-- end
-- where x, y and z are global coordinates. sin, cos, tan, exp and so forth require a 'math.' preffix.
value = 403346.1538461538
}, -- Kappa2
} -- Solid
Result = {
-- Directory in which all the results will be written. This path may use the environment variable
-- 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}/MidpointHyperelasticity/${MOREFEM_START_TIME}",
-- Enables to skip some printing in the console. Can be used to WriteSolution every n time.
-- Expected format: VALUE
display_value = 1,
-- Defines the solutions output format. Set to false for ascii or true for binary.
-- Expected format: VALUE
binary_output = false
} -- Result
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