GridapROMs.TProduct

GridapROMs.TProductModule
module TProduct

Infrastructure for tensor product finite element spaces and operators on Cartesian meshes. The key idea is that a D-dimensional Cartesian domain $[a_1,b_1] \times \cdots \times [a_D,b_D]$ can be discretised as the tensor product of D 1D meshes, allowing bilinear forms to be assembled as rank tensors of 1D matrices rather than full D-dimensional sparse matrices.

FE spaces

  • TProductFESpace: wraps a (dof-reindexed) space and a vector of D 1D (dof-reindexed) spaces_1d, all plain Gridap FESpaces.

Rank tensors

1D matrices are assembled directly on spaces_1d with Gridap's own assemble_matrix, then packed into an AbstractRankTensor (Rank1Tensor/ GenericRankTensor) directly — no dedicated tensor-product assembler is needed.

source
GridapROMs.TProduct.GenericRankTensorType
struct GenericRankTensor{D,K,A<:AbstractArray} <: AbstractRankTensor{D,K}
  decompositions::Vector{Rank1Tensor{D,A}}
end

Structure representing a generic rank-K tensor, i.e. assuming the form

$a = \sum\limits_{k=1}^K a_1^k \otimes \cdots \otimes a_D^k$

source
GridapROMs.TProduct.Rank1TensorType
struct Rank1Tensor{D,A<:AbstractArray} <: AbstractRankTensor{D,1}
  factors::Vector{A}
end

Structure representing rank-1 tensors, i.e. assuming the form

$a = a_1 \otimes \cdots \otimes a_D$

source
GridapROMs.TProduct.TProductDiscreteModelType
struct TProductDiscreteModel{D,A,B} <: DiscreteModel{D,D}
  model::A
  models_1d::B
end

A D-dimensional CartesianDiscreteModel together with D 1D CartesianDiscreteModels whose Cartesian product reproduces it.

Use TProductTriangulation and TProductMeasure to build the corresponding integration objects, and TProductFESpace (or the TensorProductReferenceFE interface) to build the FE space.

Construction

TProductDiscreteModel(args...; kwargs...)

Accepts the same arguments as CartesianDiscreteModel: a domain tuple and a partition tuple. The 1D components are split automatically from the D-dimensional CartesianDescriptor.

Example

model = TProductDiscreteModel((0,1,0,1),(10,10))  # 10×10 Cartesian mesh on [0,1]²
source
GridapROMs.TProduct.TProductFESpaceType
struct TProductFESpace{S} <: SingleFieldFESpace
  space::S
  spaces_1d::Vector{<:SingleFieldFESpace}
end

A SingleFieldFESpace on a tensor product mesh, storing the D-dimensional space and a vector of D 1D spaces_1d. Neither is reordered: their native (Gridap-assigned) dof numbering is mapped to lexicographic rank wherever a tensor/Cartesian structure is needed (get_dof_map, get_sparse_dof_map).

All standard SingleFieldFESpace interface methods are delegated to space.

The preferred construction path is via TensorProductReferenceFE:

model = TProductDiscreteModel((0,1,0,1),(10,10))
reffe = TensorProductReferenceFE(model,lagrangian,Float64,1)
V = FESpace(model,reffe;conformity=:H1,dirichlet_tags="boundary")

Alternatively, the reffe tuple form is still supported:

Ω  = Triangulation(model)
dΩ = Measure(Ω,2)
V  = FESpace(Ω,(lagrangian,Float64,1);conformity=:H1,dirichlet_tags="boundary")
source
GridapROMs.TProduct.TProductTriangulationType
struct TProductTriangulation{Dt,Dp,A,B,C} <: Triangulation{Dt,Dp}
  model::A
  trian::B
  trians_1d::C
end

A Triangulation whose cells are the Cartesian product of D 1D triangulations stored in trians_1d. The full D-dimensional triangulation trian and the background TProductDiscreteModel model are also stored for standard Gridap compatibility.

Construct via Triangulation(model::TProductDiscreteModel) or by wrapping an existing Triangulation with a vector of 1D triangulations.

source
GridapROMs.TProduct.get_decompositionMethod
get_decomposition(a::AbstractRankTensor,k::Integer) -> Vector{<:AbstractArray}

For a tensor a of dimension D and rank K assuming the form

$a = \sum\limits_{k=1}^K a_1^k \otimes \cdots \otimes a_D^k$

returns the decomposition relative to the kth rank:

$[a_1^k, \hdots , a_D^k]$

source