Commit 759a20da authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#725 Replace VariationalFormulation::BuildSolver() by a free function that may...

#725 Replace VariationalFormulation::BuildSolver() by a free function that may be used outside of a variational formulation.
parent 19e8f2a0
-- Comment lines are introduced by "--".
-- In a section (i.e. within braces), all entries must be separated by a comma.
-- transient
transient = {
-- Tells which policy is used to describe time evolution.
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant_time_step'})
time_evolution_policy = "constant_time_step",
-- 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.
-- Expected format: VALUE
-- Constraint: v >= 0.
timeMax = 2
}
-- NumberingSubset1
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 = "monolithic"
}
-- Unknown1: heat.
Unknown1 = {
-- Name of the unknown (used for displays in output).
-- Expected format: "VALUE"
name = "temperature",
-- Index of the god of dof into which the finite element space is defined.
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'scalar', 'vectorial'})
nature = "scalar"
}
-- BoundaryCondition
BoundaryCondition = {
-- 0:Pseudo-elimination, 2:penalisation
-- Expected format: VALUE
-- Constraint: v >= 0 and v < 3
essentialBoundaryConditionsMethod = 0,
-- Comp1, Comp2 or Comp3
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'Comp1', 'Comp2', 'Comp3', 'Comp12', 'Comp23', 'Comp13', 'Comp123'})
component = {"Comp1"},
--component = {},
-- Variable name the boundary condition apply to
-- Expected format: {"VALUE1", "VALUE2", ...}
variable = {"temperature"},
--variable = {},
-- Variable value at this boundary.
-- Expected format: {VALUE1, VALUE2, ...}
value = {0.},
--value = {},
-- number of labels concerned by this boundary condition
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
numLabel = {2},
--numLabel = {},
-- label (number) in the mesh file. Apply boundary condition on elements with this label
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
label = {1, 2}
--label = {}
}
-- Mesh
Mesh1 = {
-- Input Mesh file name
-- Expected format: "VALUE"
mesh = "${HOME}/Codes/HappyHeart/Data/Mesh/heat_bar_1D.geo",
--mesh = "${HOME}/Codes/HappyHeart/Data/Mesh/reaction_diffusion_1D.geo",
-- Format of the input mesh.
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'Ensight', 'Medit'})
format = "Ensight",
-- 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.
-- Constraint: v <= 3 and v > 0
dimension = 1
}
-- Domain1 - The 1D elements.
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}
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: ops_in(v, {0, 1, 2, 3})
dimension_list = { 1 },
-- 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.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
}
-- Domain2 - Neumann boundary conditions.
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}
-- Expected format: VALUE
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: ops_in(v, {0, 1, 2, 3})
dimension_list = { 0 },
-- 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.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
}
-- Domain3 - Robin boundary conditions.
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}
-- Expected format: VALUE
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: ops_in(v, {0, 1, 2, 3})
dimension_list = { 0 },
-- 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.
-- Expected format: {"VALUE1", "VALUE2", ...}
geometric_element_type_list = { }
}
-- FiniteElementSpace1
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 = {"temperature"},
-- 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
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 = 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 = {"temperature"},
-- 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 }
}
-- FiniteElementSpace3
FiniteElementSpace3 = {
-- 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 = {"temperature"},
-- 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 }
}
-- Petsc
Petsc = {
-- Absolute tolerance
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v > 0.
absoluteTolerance = {1e-50},
-- gmresStart
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
gmresRestart = {200},
-- Maximum iteration
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v > 0
maxIteration = {1000},
-- List of preconditioner: { none jacobi sor lu bjacobi ilu asm cholesky }.
-- To use mumps: preconditioner = lu
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'none', 'jacobi', 'sor', 'lu', 'bjacobi', 'ilu', 'asm', 'cholesky'})
preconditioner = {"lu"},
-- Relative tolerance
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v > 0.
relativeTolerance = {1e-9},
-- List of solver: { chebychev cg gmres preonly bicg python };
-- To use Mumps choose preonly.
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'chebychev', 'cg', 'gmres', 'preonly', 'bicg', 'python'})
solver = {"preonly"}
}
-- Result
Result = {
-- Directory in which all the results will be written.
-- Expected format: "VALUE"
--output_directory = "/Volumes/Data/gautier/HappyHeart/Results/Heat/Sequential/Dynamic/1D/SIM_REF"
output_directory = "/Volumes/Data/gautier/HappyHeart/Results/Heat/Sequential/Dynamic/1D/Test"
--output_directory = "/Volumes/Data/gautier/HappyHeart/Results/Heat/Sequential/Static/1D/SIM_REF"
--output_directory = "/Volumes/Data/gautier/HappyHeart/Results/Heat/Parallel/Dynamic/1D/SIM_REF"
--output_directory = "/Volumes/Data/gautier/HappyHeart/Results/Heat/Parallel/Static/1D/SIM_REF"
--output_directory = "/Volumes/Data/gautier/HappyHeart/Results/ReactionDiffusion/Sequential/Dynamic/1D/Test2/"
}
-- DiffusionDensity
DiffusionDensity = {
-- How is given the diffusion density (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
-- Value of the diffusion density in the case nature is 'constant'(irrelevant otherwise). This density is
-- the coefficient in front of the time derivative of the unknown (e.g. mass density x specific heat
-- capacity for the heat problem).
-- Expected format: VALUE
-- Constraint: v > 0.
scalar_value = 1.,
-- Value of the diffusion density in the case nature is 'lua_function'(irrelevant otherwise). This density
-- is the coefficient in front of the time derivative of the unknown (e.g. mass density x specific heat
-- capacity for the heat problem).
-- Expected format: Function in Lua language, for instance:
-- -- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a
-- 'math.' preffix.
-- If you do not wish to provide one, put anything you want (e.g. 'none'): the content
-- is not interpreted by Ops until an actual use of the underlying function.
lua_function = none
}
-- DiffusionTensor
DiffusionTensor = {
-- How is given the diffusion tensor (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
-- Value of the diffusion tensor in the case nature is 'constant'(irrelevant otherwise). E.g. the thermal
-- conductivity tensor in heat conduction.
-- Expected format: VALUE
-- Constraint: v > 0.
scalar_value = 1.,
-- Value of the diffusion tensor in the case nature is 'lua_function'(irrelevant otherwise). E.g. the
-- thermal conductivity tensor in heat conduction.
-- Expected format: Function in Lua language, for instance:
-- -- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a
-- 'math.' preffix.
-- If you do not wish to provide one, put anything you want (e.g. 'none'): the content
-- is not interpreted by Ops until an actual use of the underlying function.
lua_function = none
}
-- DiffusionTransfertCoefficient
DiffusionTransfertCoefficient = {
-- How is given the transfert coefficient (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'constant', 'lua_function', 'piecewise_constant_by_domain'})
nature = "constant",
-- Value of the transfert coefficient in the case nature is 'constant'(irrelevant otherwise), e.g. the heat
-- transfer coefficient.
-- Expected format: VALUE
-- Constraint: v > 0.
scalar_value = 0.,
-- Value of the transfert coefficient in the case nature is 'lua_function'(irrelevant otherwise), e.g. the
-- heat transfer coefficient.
-- Expected format: Function in Lua language, for instance:
-- -- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a
-- 'math.' preffix.
-- If you do not wish to provide one, put anything you want (e.g. 'none'): the content
-- is not interpreted by Ops until an actual use of the underlying function.
lua_function = none
}
-- TransientSource - Volumic
TransientSource1 = {
-- How is given the transient source value (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'ignore', 'constant', 'lua_function'})
nature = {"constant", "constant", "constant"},
-- Value of the transient source in the case nature is 'constant'(irrelevant otherwise).
-- Expected format: VALUE
scalar_value = { 0. , 0., 0.},
-- Value of the transient source for the component x in the case nature is 'lua_function'(irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
-- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a 'math.' preffix.
lua_function_x = function (x, y, z)
return 0.;
end,
lua_function_y = function (x, y, z)
return 0.;
end,
lua_function_z = function (x, y, z)
return 0.;
end
}
-- TransientSource - Neumann
TransientSource2 = {
-- How is given the transient source value (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'ignore', 'constant', 'lua_function'})
nature = {"constant", "constant", "constant"},
-- Value of the transient source in the case nature is 'constant'(irrelevant otherwise).
-- Expected format: VALUE
scalar_value = { 0. , 0., 0.},
-- Value of the transient source in the case nature is 'lua_function'(irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
-- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a 'math.' preffix.
lua_function_x = function (x, y, z)
return 0.;
end,
lua_function_y = function (x, y, z)
return 0.;
end,
lua_function_z = function (x, y, z)
return 0.;
end
}
-- TransientSource - Robin
TransientSource3 = {
-- How is given the transient source value (as a constant, as a Lua function, per quadrature point, etc...)
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'ignore', 'constant', 'lua_function'})
nature = {"constant", "constant", "constant"},
-- Value of the transient source in the case nature is 'constant'(irrelevant otherwise).
-- Expected format: VALUE
scalar_value = { 0. , 0., 0.},
-- Value of the transient source for the component x in the case nature is 'lua_function'(irrelevant otherwise).
-- Expected format: Function in Lua language, for instance:
-- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a 'math.' preffix.
lua_function_x = function (x, y, z)
return 0.;
end,
lua_function_y = function (x, y, z)
return 0.;
end,
lua_function_z = function (x, y, z)
return 0.;
end
}
-- InitialCondition
InitialCondition = {
-- Initial Condition
-- Expected format: Function in Lua language, for instance:
-- function(arg1, arg2, arg3)
-- return arg1 + arg2 - arg3
-- end
-- sin, cos and tan require a 'math.' preffix.
--
value = function (x, y, z)
--return 0.;
return 10*math.exp(-(x-0.5-10/2)^2);
--return math.exp(-0.5*((x-0.01-1/2)/0.1)^2);
end
}
-- Comment lines are introduced by "--".
-- In a section (i.e. within braces), all entries must be separated by a comma.
-- transient
transient = {
-- Time step between two iterations, in seconds.
-- Expected format: VALUE
-- Constraint: v > 0.
timeStep = 0.1,
-- Physical time.
-- Expected format: VALUE
-- Constraint: v >= 0.
time = 0.,
-- Maximum time.
-- Expected format: VALUE
timeMax = 0.,
}
-- variable
variable = {
-- Name of the variable considered.
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'displacement', 'pressure'})
variable = {"displacement"},
-- Nature
-- Constraint: ops_in(v, {'scalar', 'vectorial'})
nature = {"vectorial"},
-- degreeOfExactness.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
degreeOfExactness = {2},
-- Type of finite element: 0:linear, 1:quadratic.
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: ops_in(v, {'P1', 'P2'})
typeOfFiniteElement = {'P1'}
}
-- BoundaryCondition
BoundaryCondition = {
-- 0:Pseudo-elimination, 2:penalisation
-- Expected format: VALUE
-- Constraint: v >= 0 and v < 3
essentialBoundaryConditionsMethod = 0,
-- Comp1, Comp2 or Comp3
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'Comp1', 'Comp2', 'Comp3', 'Comp12', 'Comp23', 'Comp13', 'Comp123'})
component = {"Comp12"},
-- Variable name the boundary condition apply to
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'displacement', 'pressure'})
variable = {"displacement"},
-- Variable value at this boundary.
-- Expected format: {VALUE1, VALUE2, ...}
value = {0., 0.},
-- // Constant, Vector, FunctionT, FunctionS or FunctionTS
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'Constant', 'Vector', 'FunctionT', 'FunctionS' or 'FunctionTS'})
typeValue = {"Constant"},
-- number of labels concerned by this boundary condition
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
numLabel = {1},
-- label (number) in the mesh file. Apply boundary condition on elements with this label
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
label = {1},
}
-- miscellaneous
miscellaneous = {
-- Verbose index (the higher the more verbosy the code is).
-- Expected format: VALUE
-- Constraint: v >= 0
verbose = 0,
}
-- Mesh
Mesh1 = {
-- Input Mesh file name
-- Expected format: "VALUE"
mesh = "/Volumes/Data/sebastien/Freefem/Elasticity/Data/Medit/elasticity_Nx20_Ny5_force_label.mesh",
-- Format of the input mesh.
-- Expected format: "VALUE"
-- Constraint: ops_in(v, {'Ensight', 'Medit'})
format = "Medit"
}
-- Petsc
Petsc = {
-- Absolute tolerance
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v > 0.
absoluteTolerance = {1e-10},
-- gmresStart
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v >= 0
gmresRestart = {200},
-- Maximum iteration
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v > 0
maxIteration = {1000},
-- List of preconditioner: { none jacobi sor lu bjacobi ilu asm cholesky }.
-- To use mumps: preconditioner = lu
-- Expected format: {"VALUE1", "VALUE2", ...}
-- Constraint: ops_in(v, {'none', 'jacobi', 'sor', 'lu', 'bjacobi', 'ilu', 'asm', 'cholesky'})
preconditioner = {"lu"},
-- Relative tolerance
-- Expected format: {VALUE1, VALUE2, ...}
-- Constraint: v > 0.
relativeTolerance = {1e-6},