![]() |
FemProcess
The GeMA Fem Process Plugin
|
The solver options to nonlinear transient solvers with 'transient nonlinear' scheme can be defined in GeMA by using code simillar to the following fragment:
In addition, you can define some controls for time increment. In this case, the option timeControl is defined as true (default false). Then, you can modify the default time control parameters:
The solver options to nonlinear transient solvers with 'transient automatic time step' scheme can be defined in GeMA by using code simillar to the following fragment:
fem.init(physicsList, numericSolver, solverOptions) | ||
---|---|---|
Description: | Creates and initializes a transient nonlinear FEM solver intended to be used on a time loop as exemplified above. Returns a solver object that should be passed as parameter in calls to fem.Step() . | |
Parameters: | physicsList | A string with the id of the physics responsible for providing the FEM process with the equations to be solved. Can also be a table with multiple physics ids. All physics objects must be tied to the same mesh. |
numericSolver | A string with the id of the numeric solver that will be used to solve the final linear system. | |
solverOptions | The nonlinear transient solution escheme allows setting flags with options for the solver. These flags can be: requiered, optional and advanced. A required Lua table with a set of flags defining options for the nonlinear transient solver accepts the following options: - type: Defines the type of transient nonlinear solver available, two methods are implemented and a name or type is assigned: 'transient nonlinear and 'transient automatic time step', the first based on the Euler scheme and the second based on the automatic adaptive scheme with local error control proposed by Sloan & Abbo. - timeMax: Sets the total time of analysis. - timeInitIncrement: Sets the initial time increment. - timeMinIncrement: An options that defines the minimum increment of time allowed for the analysis. - timeMaxIncrement: An option that defines the maximum time increment allowed during the analysis. - iterationMax: Sets the maximum number of iterations allowed in the Newton-Raphson scheme. - tolerance: Options that allowed to define a tolerance, for the control of the error during the iterative process. Tolerance is defined by each physics involved in the analysis: mechanic, hydraulic, thermic and chemical. If the user does not set the required tolerance value, the default value of 1.0e-05 will be used. An optional Lua table with a set of flags defining options for the solver. The transient linear solver accepts the following options: - assemblerDofMode: A an optional string parameter that instructs the solver how fixed dofs should be treated. By default (assemblerDofMode empty or equal to "automatic" ), the solver selects how to work. The option "add fixed dofs" tells the solver that global matrices should include lines for fixed dofs that will be removed prior to solving the system. The option "remove fixed dofs" tells the solver that the assembler should remove fixed dofs and don't include them on the assembled matrix at all. This is a superior option (and the default option for the linear solver) but at the moment can not be used when boundary condition application points change over the simulation time (it can be used though if bc values are changing, without changing the nodes / edges / faces to which they are applied). - numThreads: An option that defines the desired number of worker threads that will be used. If this option is missing, or is equal to -1, the project configured maximum number of concurrent threads, maxThreads from the simulation options, will be used. A value greater than maxThreads will revert to that maximum. A value of zero disables threading, meaning that tasks will be executed by the main thread. A value of 1, although weird, can be used for testing: all tasks are executed by a single thread, different from the main one. - numTasks: An option that defines the number of tasks that the assembler will use to process mesh elements. If this option is missing or is equal to 0, the default number of tasks, defNumTasks from the simulation options, will be used. A value greater than 0 specifies a fixed number of tasks while a value less than 0 specifies a multiple of the number of worker threads, so a value of 5 means exactly 5 tasks, while a value of -2 means that the number of tasks should be equal to twice the number of worker threads. - cellPartitionStrategy: An option that defines the default strategy that will be used to partition mesh cells into tasks. If this option is missing, the default strategy, defCellPartitionStrategy from the simulation options, will be used. Accepted values are "default" and "sequential" . - printOptions: A table with a set of print options for the solver. This options can instruct the solver to print all of its internal matrices and are usefull when debugging new physics implementations or to fully understand the FEM process behavior. | |
Returns: | The solver object. |
Nonlinear transient solvers with 'transient nonlinear' and 'transient automatic time step' scheme can be orchestrated in GeMA by using code simillar to the following fragment
dtnew = fem.step(solver, dt) | ||
---|---|---|
Description: | Executes a new time step of the transient nonlinear solver created by the previous call to fem.init() . Should be called inside a loop until reaching the maxTime sets of the simulation. | |
Parameters: | solver | The solver object returned by fem.initTransientSolver() . |
dt | The time step that should be used for advancing the simulation time. The value is expected to be given in the current time simulation unit defined in a call to setCurrentTimeUnit() , or in seconds if this function was not called. | |
dtnew | The new time step calculated, should be used for advancing the simulation time. setCurrentTimeUnit() , or in seconds if this function was not called. | |
Returns: | Nothing. |
Nonlinear transient solvers with 'transient nonlinear' scheme can be orchestrated in GeMA by using code simillar to the following fragment
dtnew,err,conv,niter = fem.step(solver, dt, true) | ||
---|---|---|
Description: | Executes a new time step of the transient nonlinear solver created by the previous call to fem.init() . Should be called inside a loop until reaching the maxTime sets of the simulation. | |
Parameters: | solver | The solver object returned by fem.initTransientSolver() . |
dt | The time step that should be used for advancing the simulation time. The value is expected to be given in the current time simulation unit defined in a call to setCurrentTimeUnit() , or in seconds if this function was not called. | |
dtnew | The new time step calculated, should be used for advancing the simulation time. The user can decide to use this new calculated time increment, or set it to another value. | |
err | The error value calculated during the iterative process is returned in this variable. | |
conv | A Boolean is returned if convergence was possible for the current time increment. Then the conv variable will be true or false. | |
niter | An integer value is returned that indicates how many iterations were required for the time increment during the iterations of the Newton-Raphson scheme. | |
Returns: | Nothing. |