Embedded

Warning

This page is still under construction! Please refer to the tutorial for a discussion of functionality.

Warning

Non-TET/TRI polytopes are simplexified by GridapEmbedded when cutting. As a result, derivative information from AD will not be correct when using a mesh that isn't made of TRI/TET. Please use a mesh with TRI/TET polytopes to ensure correctness of derivative results.

Isolated volumes

EmbeddedCollection and EmbeddedPDEConstrainedFunctionals

GridapTopOpt.EmbeddedCollection — Type
struct EmbeddedCollection{A<:Union{WithCut,WithoutCut}}
  recipes :: Vector{<:Function}
  objects :: Dict{Symbol,Any}
  bgmodel :: DiscreteModel
end

A collection of embedded objects on the same background model. This structure provides a way to update all the stored objects at once.

Constructor

  • EmbeddedCollection(recipes::Union{<:Function,Vector{<:Function}},bgmodel::DiscreteModel[,φh];compute_cut::Bool=true)

If provided, φh will be used to compute the initial collection of objects. If not provided, the collection will remain empty until update_collection! is called. The compute_cut flag indicates whether to compute cut geometries, if false, the recipes will be called with only φh.

API:

  • update_collection!(c::EmbeddedCollection,φh): Update the collection of objects using the level set function φh.
  • add_recipe!(c::EmbeddedCollection,r::Function[,φh]): Add a recipe to the collection. Update the collection if φh is provided. The recipe r is expected to have the signature r(cutgeo,cutgeo_facet,φh) if compute_cut = true and r(φh) if compute_cut = false.
source

We implement special structures that update the state map etc. on the fly using EmbeddedPDEConstrainedFunctionals:

GridapTopOpt.EmbeddedCollection_in_φh — Function
EmbeddedCollection_in_φh(recipes::Union{<:Function,Vector{<:Function}},bgmodel,φ0)

Returns an EmbeddedCollection whoose recipes are only updated using the parameter φ0. This is useful for problems where the recipes are not computed using the cut geometry information.

source
GridapTopOpt.EmbeddedPDEConstrainedFunctionals — Type
struct EmbeddedPDEConstrainedFunctionals{N,T} <: AbstractPDEConstrainedFunctionals{N}

A version of PDEConstrainedFunctionals that has an embedded_collection to allow the state_map to be updated given new FE spaces for the forward problem. This is currently required for unfitted methods.

source
GridapTopOpt.evaluate_functionals! — Method
evaluate_functionals!(pcf::EmbeddedPDEConstrainedFunctionals,φh;update_space::Bool=true)

Evaluate the objective and constraints at φh.

Warning

Taking update_space = false will NOT update the underlying finite element spaces and assemblers that depend on φh. This should only be used when you are certain that φh has not been updated.

source
GridapTopOpt.evaluate_derivatives! — Method
evaluate_derivatives!(pcf::EmbeddedPDEConstrainedFunctionals,φh;update_space::Bool=true)

Evaluate the derivatives of the objective and constraints at φh.

Warning

Taking update_space = false will NOT update the underlying finite element spaces and assemblers that depend on φh. This should only be used when you are certain that φh has not been updated.

source
Gridap.Arrays.evaluate! — Method
Fields.evaluate!(pcf::EmbeddedPDEConstrainedFunctionals,φh;update_space::Bool=true)

Evaluate the objective and constraints, and their derivatives at φh.

Warning

Taking update_space = false will NOT update the underlying finite element spaces and assemblers that depend on φh. This should only be used when you are certain that φh has not been updated.

source

Automatic shape differentiation

See discussion in PolytopalCutters.