Utilities
Ersatz material interpolation
GridapTopOpt.SmoothErsatzMaterialInterpolation
— Typestruct SmoothErsatzMaterialInterpolation{M<:Vector{<:Number},N<:Vector{<:Number}}
A wrapper holding parameters and methods for interpolating an integrand across a single boundary $\partial\Omega$.
E.g., $\int f~\mathrm{d}\Omega = \int I(\varphi)f~\mathrm{d}D$ where $\Omega\subset D$ is described by a level-set function $\varphi$ and $I$ is an indicator function.
Properties
η::M
: the interpolation or smoothing radius across ∂Ωϵ::M
: the ersatz material densityH
: a smoothed Heaviside functionDH
: the derivative ofH
I
: an indicator functionρ
: a function describing the volume density of $\Omega$ (e.g., $\mathrm{Vol}(\Omega) = \int \rho(\varphi))~\mathrm{d}D)$
Note
- We store η and ϵ as length-one vectors so that updating these values propagates through H, DH, etc.
- To update η and/or ϵ in an instance
m
, takem.η .= <VALUE>
. - A conviencence constructor is provided to create an instance given
η<:Number
andϵ<:Number
.
Mesh labelling
GridapTopOpt.update_labels!
— Functionupdate_labels!(e::Int,model,f_Γ::Function,name::String)
Given a tag number e
, a DiscreteModel
model, an indicator function f_Γ
, and a string name
, label the corresponding vertices, edges, and faces as name
.
Note: f_Γ
must recieve a Vector and return a Boolean depending on whether it indicates Γ
Helpers
GridapTopOpt.initial_lsf
— Functioninitial_lsf(ξ,a;b)
Generate a function f
according to f(x) = -1/4 ∏ᵢ(cos(ξπ(xᵢ-bᵢ))) - a/4 where x is a vector with components xᵢ.
GridapTopOpt.isotropic_elast_tensor
— Functionisotropic_elast_tensor(D::Int,E::M,v::M)
Generate an isotropic SymFourthOrderTensorValue
given a dimension D
, Young's modulus E
, and Poisson's ratio v
.
GridapTopOpt.get_cartesian_element_sizes
— Functionget_cartesian_element_sizes(model)
Given a CartesianDiscreteModel return the element size as a tuple.
GridapTopOpt.get_element_diameters
— Functionget_element_diameters(model)
Given a general unstructured model return the maximum vertex length of a polytope.
GridapTopOpt.get_element_diameter_field
— Functionget_element_diameter_field(model)
Given a general unstructured model return the maximum vertex length as a CellField over the triangulation.
Currently, we use different naming for returning the size of elements for a CartesianDiscreteModel
and a general DiscreteModel
.
- The function
get_element_diameters
returns a list of element diameters and should be used forTRI
andTET
polytopes (this can be extended toQUAD
andHEX
if needed). - The legacy function
get_cartesian_element_sizes
returns a tuple of a single element size for a mesh with homogenous sizes.