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 CartesianDiscreteModel
or DistributedDiscreteModel
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_el_Δ
— Functionget_el_Δ(model)
Given a CartesianDiscreteModel or DistributedDiscreteModel that is uniform, return the element size as a tuple.