![]() |
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 scheme allows setting flags with options for the solver. These flags can be: required, 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. - 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 and/or save all of its internal matrices and are useful when debugging new physics implementations or to fully understand the FEM process behavior. - report: A flag that when set to true enables the generation of a report file that summarizes some important information on each FEM increment attempt, such as the simulation time, the number of non-linear steps, the increment error, etc. This report is updated as the simulation unfolds and can be used to track the execution in a more concise way, complementing the standard log file. - reportDetailed: If set to true, the report will include additional columns that help analysing the efficiency of the solver. Ignored if report is not set to true. - reportId: If the orchestration includes more than one solver (a two-way analysis, for example, or a full solver with an added geostatic step), and the report is shared between them (see reportFile), the reportId provides a tag that helps to distinguish each solver in the report. If not given and the report includes more than one solver, a numeric id will be generated automatically. - reportFile: The name of the report file. Can include path macros. If the file extension is .csv, a comma separated file will be generated. Otherwise a formatted text file will be generated. If two solvers share the same report file name, that single report will be used to collect all those solvers entries. The default value for this option is "$SIMULATIONDIR/femlog.txt". | |
| 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. | |