ComputationalModels
HyperFEM.ComputationalModels.L2_projection — Method
Perform an L2 projection of a function u onto a finite element space V defined over the domain Ω with measure dΩ.
HyperFEM.ComputationalModels.get_Neumann_dΓ — Method
get_Neumann_dΓ(...)::Vector{Gridap.CellData.GenericMeasure}Return a collection of boundary triangulations at the specified Neumann boundaries.
HyperFEM.ComputationalModels.interpolate_L2_field — Function
Interpolate an L2 field into an H1 field. The type of the field is inferred from the cell field x and the measure dΩ.
HyperFEM.ComputationalModels.residual_Neumann — Method
residual_Neumann(...)::FunctionReturn the Neumann residual as a FUNCTION.
HyperFEM.ComputationalModels.update_displacements! — Method
update_displacements!Update the old displacement field xh⁻ with the new displacement field xh⁺. The update is performed in place, modifying xh⁻ to match both the free dof values and the dirichlet dof values of xh⁺.
HyperFEM.ComputationalModels.update_velocity! — Method
update_velocity!Update the velocity field vh based on the current displacement field xh⁺ and the previous displacement xh⁻ using a midpoint time-stepping scheme. The velocity is updated in place.
DiscreteModeling
HyperFEM.DiscreteModeling — Module
A bundle of helper tools to work with discrete models in space/time.
HyperFEM.DiscreteModeling.add_tag_from_vertex_filter! — Method
Create a new tag from a geometry and a coordinate-based filter function. The filter function takes in vertex coordinates and returns a boolean values. A geometrical entity is tagged if all its vertices pass the filter.
See also
Gridap.Geometry.face_labeling_from_vertex_filterGridap.Geometry.merge!
HyperFEM.DiscreteModeling.aspect_ratio — Method
Return the aspect ratio of the underlying cartesian elements as a string. This function is only available for an underlying CartesianGrid.
Example
aspect_ratio(Ω) # "51:51:5"
aspect_ratio(Ω, tol=0.05) # "10:10:1"
aspect_ratio(uh⁺, tol=0.1) # "10:10:1"HyperFEM.DiscreteModeling.element_size — Method
Return the element size for a cartesian mesh. This function is only available for an underlying CartesianGrid.
Example
element_size(model) # Compute the diagonal
element_size(uh, :x) # Get the x-size of the underlying gridHyperFEM.DiscreteModeling.CartesianTags — Module
Shortcuts for the tags of cartesian discrete models.
Example
geometry = CartesianDiscreteModel(domain, partition)
labels = get_face_labeling(geometry)
add_tag_from_tags!(labels, "top", CartesianTags.faceXY1) # Edges and vertices are excluded
add_tag_from_tags!(labels, "bottom", CartesianTags.faceXY0⁺) # Edges and vertices are included
add_tag_from_tags!(labels, "x_sym", [CartesianTags.face0YZ; CartesianTags.edge0Y0; CartesianTags.edge0Y1])
add_tag_from_tags!(labels, "center_axis", CartesianTags.edge00Z⁺)HyperFEM.DiscreteModeling.EvolutionFunctions — Module
The evolution functions have been designed to apply variable boundary conditions.
HyperFEM.DiscreteModeling.EvolutionFunctions.constant — Method
Return a constant function which is always evaluated to 1.
\[f(x) = 1\]
HyperFEM.DiscreteModeling.EvolutionFunctions.heaviside — Method
Return the Heaviside function.
\[f(t) = H(t,T)\]
HyperFEM.DiscreteModeling.EvolutionFunctions.ramp — Function
Return a bounded ramp function from 0 to 1. By default, the slope is the identity. Otherwise, the scaling factor is 1/T.
\[f(t) = \begin{cases} 0 &, t < 0 \\ t/T &, 0 \leq t < T \\ 1 &, t \geq T \end{cases}\]
HyperFEM.DiscreteModeling.EvolutionFunctions.smoothstep — Method
Return a sigmoid-like function centered at T and edges at ±ϵ. by default, T=ϵ.
\[u(t) = \frac{t - T + \epsilon}{2\epsilon} \\[10pt] f(t) = \begin{cases} 0 &, u < 0 \\ 3u^2 - 2u^3 &, 0 \leq u < 1 \\ 1 &, u \geq 1 \end{cases}\]
HyperFEM.DiscreteModeling.EvolutionFunctions.triangular — Method
Return a triangular evolution function ranging from 0 to 1, centered at Tmax, having edges at T0 and 2Tmax-T0. By default, T0=0 and Tmax=T.
\[f(t) = \begin{cases} 0 &, t < T_0 \\ \frac{t-T_0}{T_{max}-T_0} &, T_0 \leq t < T_{max} \\ 1-\frac{t-T_{max}}{T_{max}-T_0} &, T_{max} \leq t < 2T_{max}-T_0 \\ 0 &, t \geq 2T_{max}-T_0 \end{cases}\]
PhysicalModels
Gridap.CellData.CellState — Method
CellState(model, dΩ)Initialize the state variables for the given constitutive model and discretization. The constitutive model passed to the function will determine the type of the state variables, e.g., a vector, tensor, tuple of state variables...
HyperFEM.PhysicalModels.CoerciveVolumetric — Type
Coercive volumetric energy term of the form:
\[\Psi = \frac{\kappa}{4} (J^2-1+\log(J))\]
HyperFEM.PhysicalModels.EightChain — Type
Simplified eight-chain model by Arruda and Boyce. the implementation uses the first five terms of the inverse Langevin function.
\[\Psi = C_1 \sum_{i=1}^{3} \alpha_i \beta^{i-1} (I_1^i - 3^i)\]
HyperFEM.PhysicalModels.IsochoricNeoHookean3D — Type
Neo-Hooke hyperelastic model
\[\Psi = \frac{1}{2}\mu (I_1 - 3)\]
HyperFEM.PhysicalModels.PlaneStressIncompressible_I1PD — Type
Plane stress incompressible linear I1 pressure distorsion
\[\Psi = F ⊙ F + λ_{33}^2 - 3*(J(F)*λ_{33})^(2/3)\]
HyperFEM.PhysicalModels.ViscousPolyconvex — Type
Polyconvex viscoelastic constitutive model for the set of variables {F, J, Cᵥ}, where F is the deformation gradient, J is the jacobian and Cᵥ is the viscous strain.
Key features:
- Factorization-free: Fast calculation of the intermediate state without matrix factorizations.
- Neo-Hookean equilibrium: Uses a neo-Hookean expression for the underlying equilibrium term.
- Distortional invariants: Formulated using distortional invariants rather than deviatoric ones.
Fields
μ::Float64: Shear modulus.τ::Float64: Relaxation time.Δt::Base.RefValue{Float64}:Referenceto the time step.
HyperFEM.PhysicalModels.VolumetricEnergy — Type
Volumetric energy term of the form:
\[\Psi = \frac{\kappa}{2} (J-1)^2\]
HyperFEM.PhysicalModels.Yeoh3D — Type
Yeoh constitutive model.
\[\Psi = \sum_{i=1}^3 C_i (I_1 - 3)^i\]
Gridap.CellData.update_state! — Method
update_state!(model, A, F, Fn)Update the state variables. The state variables must be initialized using the function CellState with the constitutive model.
NOTE: The Gridap function expects the following order of arguments: update_state!(updater, cell_states, cell_fields), hence, the order of the arguments differ from the standar energy function, like Ψ(F, Fn, A...)
HyperFEM.PhysicalModels.Dissipation — Method
Dissipation(model)Return the dissipation and its derivatives if any.
HyperFEM.PhysicalModels.SecondPiola — Method
SecondPiola(model)Return the energy density and its derivatives as functions of C instead of F.
HyperFEM.PhysicalModels.initialize_state — Method
initialize_state(model)Define the state variable at a Gauss point. Unlike the function CellState, the returned state variable is represented by a number or a tensor.
HyperFEM.PhysicalModels.return_mapping — Method
return_mapping(model, F, Fn, A...)Update the state variables at a Gauss point. Unlike the function update_state!, the state variables are represented by a number or a tensor.
HyperFEM.PhysicalModels.update_time_step! — Method
update_time_step!(model, Δt)Set the time step to be used internally by the constitutive model. The time step is a reference, hence, the weak forms derived from the constitutive model will be automatically updated with the new time step.
Solvers
TensorAlgebra
HyperFEM.TensorAlgebra.:⊗₁² — Method
⊗₁²(A::VectorValue{D}, B::VectorValue{D})::TensorValue{D,D}Outer product of two first-order tensors (vectors), returning a second-order tensor (matrix).
HyperFEM.TensorAlgebra.:⊗₁²³ — Method
⊗₁²³(A::VectorValue{D}, B::TensorValue{D})::TensorValue{D,D*D}Outer product of a first-order and second-order tensors (vector and matrix), returning a third-order tensor represented in a D x D² flattened matrix using combined indices.
HyperFEM.TensorAlgebra.:⊗₁₂³ — Method
⊗₁₂³(A::TensorValue{D}, B::VectorValue{D})::TensorValue{D,D*D}Outer product of a second-order and first-order tensors (matrix and vector), returning a third-order tensor represented in a D x D² flattened matrix using combined indices.
HyperFEM.TensorAlgebra.:⊗₁₂³⁴ — Method
⊗₁₃²⁴(A::TensorValue{D}, B::TensorValue{D})::TensorValue{D*D}Outer product of two second-order tensors (matrices), returning a fourth-order tensor represented in a D² x D² flattened matrix using combined indices.
HyperFEM.TensorAlgebra.:⊗₁₃² — Method
⊗₁₃²(A::TensorValue{D}, B::TensorValue{D})::TensorValue{D,D*D}Outer product of a second-order and first-order tensors (matrix and vector), returning a third-order tensor represented in a D x D² flattened matrix using combined indices.
HyperFEM.TensorAlgebra.:⊗₁₃²⁴ — Method
⊗₁₃²⁴(A::TensorValue{D}, B::TensorValue{D})::TensorValue{D*D}Outer product of two second-order tensors (matrices), returning a fourth-order tensor represented in a D² x D² flattened matrix using combined indices.
HyperFEM.TensorAlgebra.:⊗₁₄²³ — Method
⊗₁₄²³(A::TensorValue{D}, B::TensorValue{D})::TensorValue{D*D}Outer product of two second-order tensors (matrices), returning a fourth-order tensor represented in a D² x D² flattened matrix using combined indices.
HyperFEM.TensorAlgebra._flat_idx — Method
Return the linear index of a N-dimensional tensor.
HyperFEM.TensorAlgebra._ij — Method
Return the cartesian indices of an N-dimensional second-order tensor.
HyperFEM.TensorAlgebra._ijk — Method
Return the cartesian indices of an N-dimensional third-order tensor.
HyperFEM.TensorAlgebra._ijkl — Method
Return the cartesian indices of an N-dimensional fourth-order tensor.
HyperFEM.TensorAlgebra.cof — Method
cof(A::TensorValue)::TensorValueCalculate the cofactor of a matrix.
HyperFEM.TensorAlgebra.contraction_IJK_KLP — Method
contraction_IJK_KLP(A::TensorValue{D,D*D}, B::TensorValue{D,D*D})::TensorValue{D*D,D*D}Performs a tensor contraction between third-order tensors (represented as a D × D² matrix in flattened index notation). The operation follows the index contraction pattern, where addition is performed for repeated indices.
HyperFEM.TensorAlgebra.contraction_IP_JPKL — Method
contraction_IP_JPKL(A::TensorValue{D}, H::TensorValue{D*D})::TensorValue{D*D}Performs a tensor contraction between a second-order tensor (of size D × D) and a fourth-order tensor (represented as a D² × D² matrix in flattened index notation). The operation follows the index contraction pattern, where addition is performed for repeated indices.
HyperFEM.TensorAlgebra.contraction_IP_PJKL — Method
contraction_IP_PJKL(A::TensorValue{D}, H::TensorValue{D*D})::TensorValue{D*D}Performs a tensor contraction between a second-order tensor (of size D × D) and a fourth-order tensor (represented as a D² × D² matrix in flattened index notation). The operation follows the index contraction pattern, where addition is performed for repeated indices.
HyperFEM.TensorAlgebra.logreg — Method
Jacobian regularization
HyperFEM.TensorAlgebra.push_forward_C_to_F — Method
push_forward_C_to_F(F::TensorValue{D}, H::TensorValue{D²}) :: TensorValueAssumming C is symmetric, compute directly 0.5 * DCDF' · H · DCDF without computing the 4th order tensor DCDF.
HyperFEM.TensorAlgebra.∂log∂J — Method
Jacobian regularization
HyperFEM.TensorAlgebra.∂∂log∂JJ — Method
Jacobian regularization
WeakForms
Gridap.Algebra.jacobian — Function
jacobian(...)::Gridap.CellData.IntegrandCalculate the jacobian using the given constitutive model and finite element functions.
Gridap.Algebra.residual — Function
residual(...)::Gridap.CellData.IntegrandCalculate the residual using the given constitutive model and finite element functions.