Handles settings for adaptive mesh refinement. There are two sorts of features for adaptive mesh refinement: Adaption, which can be added to solvers of
Eigenvalue or
Stationary types, and
TimeAdaption, which can be added to a solver of the Time Dependent type.
The Adaption feature runs an overall adaptation iteration a number of steps, and in each iteration a new mesh is generated and solved for. The last mesh generated and the solution on this mesh is added to the model.
The TimeAdaption feature splits the overall time range into subintervals and in each interval an adapted mesh is generated and used. The meshes for these intervals as well as the solutions are added to the model. The solutions are stored in one container node (
model.sol()) to facilitate the result processing.
The Adaption feature accepts the following property/value pairs
The feature TimeAdaption accepts the following property/value pairs
The Adaption algorithm solves a sequence of problems using a sequence of refined meshes. The first mesh is obtained from the mesh sequence. The following generations of meshes are obtained by solving the problem, computing a mesh element error indicator based on the error estimate function, selecting a set of elements based on the element pick function, and then finally refining these elements. The solution to the problem is then recomputed. The loop continues until the maximum number of element generations has been reached or until the maximum number of elements is obtained.
Then, the residuals in the equations are computed for all mesh elements. The error estimation function is given by the property
eefun. For solver type
stationary there are two functions available:
l2 and
func. The function
l2 computes the error indicator using the
L2 norm, and the function
func computes the error indicator using a functional. For the solver type
eigenvalue only the
l2 function is available.
If the error estimate function functional is used, you must provide a functional variable name using the property
eefunc. This variable must have global scope. The algorithm computes the adjoint solution related to the functional and estimates the error in this solution. This error estimate is used for the selection of elements to refine. Two methods are supported to estimate the error in the adjoint solution: a recovery technique and a gradient-based method. By selecting
adjppr=on you can enforce using the recovery technique, and with
adjppr=off the adaptive solver uses the gradient method. When using the
auto option, the algorithm automatically detects if the model uses only Lagrange basis function. If so, the recovery technique is used. Otherwise, the algorithm chooses the gradient-based method. In the Solver Log you can inspect which method that is selected. See
Adaptive Mesh Refinement (Utility Node) in the
COMSOL Multiphysics Reference Manual for more information.
The error estimator gives local error indicators (f(i, j)h(j)β(i))αVol(j), where
i is the equation number,
j is the mesh element number,
h is the mesh element size, and
Vol is the mesh element volume.
f(
i,
j) is the scaled absolute value of the
ith equation residual on the
jth mesh element. The mesh element error indicator is the sum of these local error indicators over the equation index
i. The global error indicator is the
α root of the sum of the mesh element error indicators over the mesh element index
j.
Then, a refinement of the mesh is generated based on the local error indicators. The aim is to refine the mesh most where the errors are largest. The mesh refinements ratios are determined by the property elselect, and depending on the value of
elselect on one of the parameters
globalminpar,
worstpar, and
elementspar. If
elselect=globalmin, the solver tries to minimize the total error for a prescribed mesh size, namely
globalminpar times the current number of mesh elements. Each element can be refined several times. Otherwise, each element is refined at most once. If
elselect=worst, the solver refines the elements with an error greater than a fraction
worstpar of the worst error, whereas if
elselect=elements the solver refines a given fraction of the elements, given in the property
elementspar.
The property resorder is a scalar or vector that gives the order of decrease of the equation residuals as the mesh size
h tends to 0. If it is a vector, the residual of the
nth equation is
O(
hResorder(n)). If
resorder equals
auto, the software determines the order of decrease in equation residuals on the basis of the shape function orders in the model. Roughly speaking, the order is one less than the shape function order for the corresponding equation.
Once the mesh refinement ratios have been determined, the mesh is refined using the method given in the property rmethod, and the algorithm starts a new iteration. The refinement method is either
longest,
regular, or
meshinit. Details on the first two refinement methods can be found in the entry on
meshrefine.
Meshinit means that a new mesh is generated through a call to
meshinit using the
Hmesh property to control the element sizes.
No more than ngen successive refinements are attempted. Refinement is also stopped when the number of elements in the mesh exceeds
maxt.
The TimeAdaption algorithm solves a sequence of problems on a sequence of adapted meshes. The first mesh, the base mesh, is obtained from the mesh sequence. The new adapted mesh is obtained by evaluating the mesh element error indicator, selecting a set of elements based on the element pick function, and then finally refining these elements. The solution to the problem on the previous mesh is then mapped to the new mesh and time integration continues until the next mesh adaptation takes place. The time of mesh adaptation can be determined manually or automatically.
The time adaptive solver works in one geometry at a time. You specify the name of the geometry sequence in the property timeadapgeom. The solver only supports simplex meshes, and if the base mesh is not simplex it can be converted by using the property
convertmesh.
The length of the time interval using a fixed adapted spatial mesh can be controlled manually or automatically by the property tauto. If the time integrator runs into problems the computation is restarted at the beginning of the previous time interval. The length of the new interval is reduced to a fraction of the current interval length. This fraction is specified by the property
rf. In the
tauto=manual case the time interval length is given by property
tfrac; if
tauto=automatic the property
tfracauto controls the initial interval length. For both cases the shortest possible interval length is given by the property
minti.
If the property tauto is set to
automatic the TimeAdaption algorithm tries to determine the length of the time interval according to the requested fraction of maximum refinement. The fraction is given by the value of the property
elfrac. A value of zero means no refinement of the base mesh and a value of one means refinement everywhere with maximum element refinements (set through property
ngenlocal). The algorithm strives to assume the given value of
elfrac by controlling the size of the time interval. The shortening and lengthening of the interval is determined by the interval reduction and growth factors. These are the properties
rf and
gf respectively.
The error indicator is specified using the property eefunctime. A solution on the coarse base mesh is computed in the next time interval and the error indicator is evaluated at the points given by property
samplepts. In this way a new adapted mesh appropriate for the next time interval can be generated and the computation on this new mesh is then started. The sample points must be specified as a number between 0 and 1 because they are interpreted as being relative to the time interval under consideration. Entering a scalar value of 0.5 means that the error indicator is evaluated at the midpoint of the interval.