Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
57138d22
Commit
57138d22
authored
Jun 08, 2020
by
GILLES Sebastien
Browse files
#1524
Remove the mandatory status of some InputData fields.
parent
75edc91e
Changes
6
Hide whitespace changes
Inline
Side-by-side
MoReFEM.xcodeproj/project.pbxproj
View file @
57138d22
...
...
@@ -7400,12 +7400,12 @@
isa = PBXGroup;
children = (
BE4D0C8D21A2E4F900E0D4E7 /* SourceList.cmake */,
BE4D0C8E21A2E4F900E0D4E7 /* Impl */,
BE4D0C9221A2E4F900E0D4E7 /* Petsc.hxx */,
BE4D0C9321A2E4F900E0D4E7 /* ConvergenceTest.hpp */,
BE4D0C9421A2E4F900E0D4E7 /* ConvergenceTest.hxx */,
BE4D0C9521A2E4F900E0D4E7 /* Petsc.hpp */,
BE4D0C9221A2E4F900E0D4E7 /* Petsc.hxx */,
BE4D0C9621A2E4F900E0D4E7 /* ConvergenceTest.cpp */,
BE4D0C8E21A2E4F900E0D4E7 /* Impl */,
);
path = Solver;
sourceTree = "<group>";
Sources/Core/MoReFEMData/MoReFEMData.hpp
View file @
57138d22
...
...
@@ -90,6 +90,12 @@ namespace MoReFEM
//! Alias to \a InputDataT.
using
input_data_type
=
InputDataT
;
//! Whether there is a Parallelism block in MoReFEM input data.
//! \return True if there is one.
static
constexpr
bool
HasParallelismField
();
public:
/// \name Special members.
///@{
...
...
@@ -129,14 +135,14 @@ namespace MoReFEM
*
* \return Result directory.
*/
const
FilesystemNS
::
Directory
&
GetResultDirectory
()
const
noexcept
;
template
<
bool
U
=
InputDataT
::
template
Find
<
InputDataNS
::
Result
::
OutputDirectory
>()>
std
::
enable_if_t
<
U
,
const
FilesystemNS
::
Directory
&
>
GetResultDirectory
()
const
noexcept
;
//! 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:
...
...
Sources/Core/MoReFEMData/MoReFEMData.hxx
View file @
57138d22
...
...
@@ -29,12 +29,12 @@ namespace MoReFEM
>
constexpr
bool
MoReFEMData
<
InputDataT
,
ProgramTypeT
,
DoTrackUnusedFieldsT
,
AdditionalCommandLineArgumentsPolicyT
>
::
I
sParallelismField
()
::
Ha
sParallelismField
()
{
return
InputDataT
::
template
Find
<
InputDataNS
::
Parallelism
>();
}
template
<
class
InputDataT
,
...
...
@@ -80,11 +80,9 @@ namespace MoReFEM
namespace
ipl
=
Utilities
::
InputDataNS
;
using
Result
=
InputDataNS
::
Result
;
{
std
::
string
path
=
ipl
::
Extract
<
Result
::
OutputDirectory
>::
Path
(
*
input_data_
);
{
FilesystemNS
::
behaviour
directory_behaviour
;
if
constexpr
(
ProgramTypeT
==
program_type
::
model
)
...
...
@@ -96,24 +94,36 @@ namespace MoReFEM
else
if
constexpr
(
ProgramTypeT
==
program_type
::
post_processing
)
directory_behaviour
=
FilesystemNS
::
behaviour
::
read
;
result_directory_
=
std
::
make_unique
<
FilesystemNS
::
Directory
>
(
mpi
,
path
,
directory_behaviour
,
__FILE__
,
__LINE__
);
// Parallelism is an optional field: it might not be present in the Lua file (for tests for instance
// it is not meaningful).
if
constexpr
(
InputDataT
::
template
Find
<
InputDataNS
::
Parallelism
>())
parallelism_
=
std
::
make_unique
<
Internal
::
Parallelism
>
(
mpi
,
*
input_data_
,
directory_behaviour
);
if
constexpr
(
InputDataT
::
template
Find
<
InputDataNS
::
Result
::
OutputDirectory
>())
{
using
Result
=
InputDataNS
::
Result
;
std
::
string
path
=
ipl
::
Extract
<
Result
::
OutputDirectory
>::
Path
(
*
input_data_
);
result_directory_
=
std
::
make_unique
<
FilesystemNS
::
Directory
>
(
mpi
,
path
,
directory_behaviour
,
__FILE__
,
__LINE__
);
InitTimeKeepLog
(
GetResultDirectory
());
}
if
constexpr
(
InputDataT
::
template
Find
<
InputDataNS
::
Result
::
BinaryOutput
>())
{
const
auto
&
binary_output
=
ipl
::
Extract
<
InputDataNS
::
Result
::
BinaryOutput
>::
Value
(
*
input_data_
);
Utilities
::
OutputFormat
::
CreateOrGetInstance
(
__FILE__
,
__LINE__
,
binary_output
);
}
{
// Parallelism is an optional field: it might not be present in the Lua file (for tests for instance
// it is not meaningful).
if
constexpr
(
HasParallelismField
())
parallelism_
=
std
::
make_unique
<
Internal
::
Parallelism
>
(
mpi
,
*
input_data_
,
directory_behaviour
);
}
}
mpi
.
Barrier
();
InitTimeKeepLog
(
GetResultDirectory
());
const
auto
&
binary_output
=
ipl
::
Extract
<
Result
::
BinaryOutput
>::
Value
(
*
input_data_
);
Utilities
::
OutputFormat
::
CreateOrGetInstance
(
__FILE__
,
__LINE__
,
binary_output
);
if
constexpr
(
InputDataT
::
template
Find
<
InputDataNS
::
Solid
::
CheckInvertedElements
>())
{
const
auto
&
do_check_inverted_elements
=
ipl
::
Extract
<
InputDataNS
::
Solid
::
CheckInvertedElements
>
...
...
@@ -210,7 +220,12 @@ namespace MoReFEM
Utilities
::
InputDataNS
::
DoTrackUnusedFields
DoTrackUnusedFieldsT
,
class
AdditionalCommandLineArgumentsPolicyT
>
const
FilesystemNS
::
Directory
&
template
<
bool
U
>
std
::
enable_if_t
<
U
,
const
FilesystemNS
::
Directory
&
>
MoReFEMData
<
InputDataT
,
ProgramTypeT
,
DoTrackUnusedFieldsT
,
AdditionalCommandLineArgumentsPolicyT
>
::
GetResultDirectory
()
const
noexcept
{
...
...
Sources/FiniteElement/FiniteElementSpace/GodOfDof.hxx
View file @
57138d22
...
...
@@ -32,7 +32,7 @@ namespace MoReFEM
std
::
cout
<<
"GOD OF DOF INIT!"
<<
std
::
endl
;
if
constexpr
(
!
MoReFEMDataT
::
I
sParallelismField
())
if
constexpr
(
!
MoReFEMDataT
::
Ha
sParallelismField
())
{
assert
(
morefem_data
.
GetParallelismPtr
()
==
nullptr
);
std
::
cout
<<
"
\t
Standard 1"
<<
std
::
endl
;
...
...
Sources/Test/Utilities/InputData/InputData.hpp
View file @
57138d22
...
...
@@ -37,42 +37,6 @@ namespace MoReFEM
{
//! \copydoc doxygen_hide_mesh_enum
enum
class
MeshIndex
{
mesh
=
1
};
//! \copydoc doxygen_hide_domain_enum
enum
class
DomainIndex
{
domain
=
1
};
//! \copydoc doxygen_hide_felt_space_enum
enum
class
FEltSpaceIndex
{
felt_space
=
1
};
//! \copydoc doxygen_hide_unknown_enum
enum
class
UnknownIndex
{
unknown
=
1
};
//! \copydoc doxygen_hide_solver_enum
enum
class
SolverIndex
{
solver
=
1
};
//! \copydoc doxygen_hide_numbering_subset_enum
enum
class
NumberingSubsetIndex
:
unsigned
int
{
...
...
@@ -80,28 +44,12 @@ namespace MoReFEM
};
//! \copydoc doxygen_hide_input_data_tuple
using
InputDataTuple
=
std
::
tuple
<
InputDataNS
::
TimeManager
,
InputDataNS
::
NumberingSubset
<
EnumUnderlyingType
(
NumberingSubsetIndex
::
numbering_subset
)
>
,
InputDataNS
::
InterpolationFile
,
InputDataNS
::
Mesh
<
EnumUnderlyingType
(
MeshIndex
::
mesh
)
>
,
InputDataNS
::
Unknown
<
EnumUnderlyingType
(
UnknownIndex
::
unknown
)
>
,
InputDataNS
::
Domain
<
EnumUnderlyingType
(
DomainIndex
::
domain
)
>
,
InputDataNS
::
Result
,
InputDataNS
::
FEltSpace
<
EnumUnderlyingType
(
FEltSpaceIndex
::
felt_space
)
>
,
InputDataNS
::
Petsc
<
EnumUnderlyingType
(
SolverIndex
::
solver
)
>
InputDataNS
::
InterpolationFile
>
;
...
...
Sources/Test/Utilities/InputData/demo_input_parameter_test_ipl.lua
View file @
57138d22
-- 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
=
0
.
}
-- transient
NumberingSubset1
=
{
...
...
@@ -36,158 +18,6 @@ NumberingSubset1 = {
}
-- NumberingSubset1
Mesh1
=
{
-- Path of the mesh file to use.
-- Expected format: "VALUE"
mesh
=
'${MOREFEM_ROOT}/Data/Mesh/elasticity_Nx50_Ny20_force_label.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
=
2
,
-- Space unit of the mesh.
-- Expected format: VALUE
space_unit
=
1
.
}
-- Mesh1
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
=
{
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
=
{
},
-- 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
Result
=
{
-- Directory in which all the results will be written.
-- Expected format: "VALUE"
output_directory
=
'${MOREFEM_TEST_OUTPUT_DIR}/Test/Utilities/InputData'
,
-- 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
Unknown1
=
{
-- Name of the unknown (used for displays in output).
-- Expected format: "VALUE"
name
=
'unknown'
,
-- 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
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
=
1
,
-- 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
=
{
"unknown"
},
-- 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
Petsc1
=
{
-- Absolute tolerance
-- Expected format: VALUE
-- Constraint: v > 0.
absoluteTolerance
=
1e-50
,
-- 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-9
,
-- 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
-- File that gives for each vertex on the first mesh on the interface the index of the equivalent vertex in
-- the second mesh.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment