Error Estimation¶
There are two mesh refinement strategies that are implemented in TMR
:
the first is based on the strain energy norm, while the second is an
adjoint-based refinement technique. The strain energy based refinement method is
designed to reduce the solution error in the natural strain energy norm. This
call takes the form:
-
tmr.TMR.
strainEnergyError
()¶ - strainEnergyError(forest, coarse_assembler, forest_refined,
refined_assembler)
The following function performs a mesh refinement based on a strain energy criteria. It is based on the following relationship for linear finite-element analysis
\[\Pi(u-u_h,u-u_h) = \Pi(u,u) - \Pi(u_h,u_h)\]where a(u,u) is the trilinear strain energy functional, u is the exact solution, and uh is the discretized solution at any mesh level. This relies on the relationship that \(\Pi(u_h, u - u_h) = 0\) which is satisfied due to the method of Galerkin/Ritz.
The following function computes a localized error indicator using the element-wise strain energy. The code computes a higher-order reconstructed solution using a cubic enrichment functions. These enrichment functions expand the original solution space and are computed based on a least-squares approximation with nodal gradient values. The localized error indicator is evaluated as follows:
\[err = \sum_{i=1}^{4} \Pi_e(u_{ce}, u_{ce}) - \Pi_e(u_e, u_e)\]where \(u_{ce}\) is the element-wise cubic element reconstruction projected onto a uniformly refined mesh.
- Parameters
forest_coarse (
OctForest
orQuadForest
) – Forest for current mesh levelcoarse_assembler (
Assembler
) – Finite assembler class for associated with forestforest_refined (
OctForest
orQuadForest
) – Forest for refined mesh levelrefined_assembler (
Assembler
) – Finite assembler class for associated with forest_refined
- Returns
ans (double) – Total strain energy error
err (array of double) – Elemental strain energy error
The forest can be refined based on the requested target error and the solution
set in TACS
.
The adjoint-based refinement method requires an Assembler
object
for both the current level of refinement and a uniformly refined version of the
model. The adjoint-based mesh refinement takes the form:
-
tmr.TMR.
adjointError
()¶ - adjointError(forest, coarse_assembler, forest_refined, refined_assembler,
solution_refined, adjoint_refined)
Refine the mesh using the original solution and the adjoint solution
- Parameters
forest (
OctForest
orQuadForest
) – Forest for current mesh levelcoarse_assembler (
Assembler
) – Finite assembler class for associated with forestforest_refined (
OctForest
orQuadForest
) – Higher-order forest for refined mesh levelrefined_assembler (
Assembler
) – Higher-order finite assembler class for associated with forest_refinedsolution_refined (
Vec
) – The higher-order solution (or approximation)adjoint_refined (
Vec
) – The difference between the refined and coarse adjoint solutions computed in some manner
- Returns
ans (double) – Total strain energy error
err (array of double) – Elemental strain energy error
adj_corr (TacsScalar) – Adjoint-based functional correction