Utilities

Ersatz material interpolation

GridapTopOpt.SmoothErsatzMaterialInterpolationType
struct 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 density
  • H: a smoothed Heaviside function
  • DH: the derivative of H
  • 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, take m.η .= <VALUE>.
  • A conviencence constructor is provided to create an instance given η<:Number and ϵ<:Number.
source

Mesh labelling

GridapTopOpt.update_labels!Function
update_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 Γ

source

Helpers

GridapTopOpt.initial_lsfFunction
initial_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ᵢ.

source
GridapTopOpt.get_el_ΔFunction
get_el_Δ(model)

Given a CartesianDiscreteModel or DistributedDiscreteModel that is uniform, return the element size as a tuple.

source