Gridap.Geometry

Gridap.GeometryModule

Exported names are

source

Triangulations

Interface

Gridap.Geometry.TriangulationType
abstract type Triangulation{Dc,Dp}

Abstract type representing an arbitrary tiling, tessellation, or triangulation of a domain of parametric dimension Dc and physical dimension Dp.

We define a triangulation from two basic ingredients:

  • the cell-wise nodal coordinates of the cells in the triangulation, plus
  • an interpolation of this cell-wise coordinates into the cells interior.

Note that this type represents general triangulations (not necessarily conforming), which is the minimum geometrical information needed to perform cell-wise numerical integration.

The Triangulation interface is defined by overloading these methods:

Optional interface:

For triangulations living in a space of co-dimension 1, the following method can be defined:

  • [get_normal_vector(trian::Triangulation)]

In some cases, concrete implementations want to override the default implementation of the following methods:

  • [restrict(f::AbstractArray, trian::Triangulation)]
  • [get_cell_id(f::AbstractArray, trian::Triangulation)]

The (mandatory) Triangulation interface can be tested with

source
Gridap.Integration.num_point_dimsMethod
num_point_dims(::Quadrature{D}) where D
num_point_dims(::Type{<:Quadrature{D}}) where D
source
num_point_dims(::GridTopology) -> Int
num_point_dims(::Type{<:GridTopology}) -> Int
source
num_point_dims(::Triangulation) -> Int
num_point_dims(::Type{<:Triangulation}) -> Int
source
Gridap.Integration.num_dimsMethod
num_dims(::Quadrature{D}) where D where D
num_dims(::Type{<:Quadrature{D}}) where D
source
num_dims(::GridTopology) -> Int
num_dims(::Type{<:GridTopology}) -> Int

Equivalent to num_cell_dims.

source
num_dims(::Triangulation) -> Int
num_dims(::Type{<:Triangulation}) -> Int

Equivalent to num_cell_dims.

source
Gridap.Geometry.get_cell_reffesMethod
get_cell_reffes(trian::Triangulation) -> Vector{<:NodalReferenceFEs}

It is not desirable to iterate over the resulting array for large number of cells if the underlying reference FEs are of different Julia type.

source

Integrating on a triangulation

Gridap.Fields.integrateMethod
integrate(cell_field,trian::Triangulation,quad::CellQuadrature)

The cell_field is aligned with the cells in trian

source

TriangulationPortion

BoundaryTriangulations

Interface

Gridap.Geometry.BoundaryTriangulationMethod
BoundaryTriangulation(model::DiscreteModel,tags::Vector{Int})
BoundaryTriangulation(model::DiscreteModel,tags::Vector{String})
BoundaryTriangulation(model::DiscreteModel,tag::Int)
BoundaryTriangulation(model::DiscreteModel,tag::String)
source

GenericBoundaryTriangulations

SkeletonTriangulations

SkeletonPairs

Grids

Interface

Gridap.Geometry.GridType
abstract type Grid{Dc,Dp} <: Triangulation{Dc,Dp}

Abstract type that represents conforming triangulations, whose cell-wise nodal coordinates are defined with a vector of nodal coordinates, plus a cell-wise vector of node ids.

The interface of Grid is defined by overloading the methods in Triangulation plus the following ones:

From these two methods a default implementation of get_cell_coordinates(trian::Triangulation) is available.

The Grid interface has the following traits

The interface of Grid is tested with

source
Gridap.Geometry.OrientationStyleMethod
OrientationStyle(::Type{<:Grid}) -> Val{Bool}
OrientationStyle(::Grid) -> Val{Bool}

Val{true}() if has oriented faces, Val{false}() otherwise (default).

source
Gridap.Geometry.RegularityStyleMethod
RegularityStyle(::Type{<:Grid}) -> Val{Bool}
RegularityStyle(::Grid) -> Val{Bool}

Val{true}() if no hanging-nodes (refault), Val{false}() otherwise.

source

UnstructuredGrids

Gridap.Geometry.UnstructuredGridType
struct UnstructuredGrid{Dc,Dp,Tp,Ti,O} <: Grid{Dc,Dp}
  node_coordinates::Vector{Point{Dp,Tp}}
  cell_nodes::Table{Ti,Int32}
  reffes::Vector{<:NodalReferenceFE{Dc}}
  cell_types::Vector{Int8}
end
source
Gridap.Geometry.UnstructuredGridMethod
function UnstructuredGrid(
  node_coordinates::Vector{Point{Dp,Tp}},
  cell_nodes::Table{Ti},
  reffes::Vector{<:NodalReferenceFE{Dc}},
  cell_types::Vector,
  ::Val{B}=Val{false}()) where {Dc,Dp,Tp,Ti,B}
end

Low-level inner constructor.

source

CartesianGrids

Gridap.Geometry.CartesianDescriptorType
struct CartesianDescriptor{D,T,F<:Function}
  origin::Point{D,T}
  sizes::Point{D,T}
  partition::Point{D,Int}
  map::F
end

Struct that stores the data defining a Cartesian grid.

source

GridPortion

FaceLabeling

Gridap.Geometry.FaceLabelingType
struct FaceLabeling <: GridapType
  d_to_dface_to_entity::Vector{Vector{Int32}}
  tag_to_entities::Vector{Vector{Int32}}
  tag_to_name::Vector{String}
end
source
Gridap.Geometry.get_face_maskMethod
get_face_mask(labeling::FaceLabeling,tags::Vector{Int},d::Integer)
get_face_mask(labeling::FaceLabeling,tags::Vector{String},d::Integer)
get_face_mask(labeling::FaceLabeling,tag::Int,d::Integer)
get_face_mask(labeling::FaceLabeling,tag::String,d::Integer)
source
Gridap.Geometry.add_tag_from_tags!Method
add_tag_from_tags!(lab::FaceLabeling, name::String, tags::Vector{Int})
add_tag_from_tags!(lab::FaceLabeling, name::String, tags::Vector{String})
add_tag_from_tags!(lab::FaceLabeling, name::String, tag::Int)
add_tag_from_tags!(lab::FaceLabeling, name::String, tag::String)
source
Gridap.Geometry.get_face_tagMethod
get_face_tag(labeling::FaceLabeling,tags::Vector{Int},d::Integer)
get_face_tag(labeling::FaceLabeling,tags::Vector{String},d::Integer)
get_face_tag(labeling::FaceLabeling,tag::Int,d::Integer)
get_face_tag(labeling::FaceLabeling,tag::String,d::Integer)
get_face_tag(labeling::FaceLabeling,d::Integer)

The first of the given tags appearing in the face is taken. If there is no tag on a face, this face will have a value equal to UNSET. If not tag or tags are provided, all the tags in the model are considered

source
Gridap.Geometry.get_face_tag_indexMethod
get_face_tag_index(labeling::FaceLabeling,tags::Vector{Int},d::Integer)
get_face_tag_index(labeling::FaceLabeling,tags::Vector{String},d::Integer)
get_face_tag_index(labeling::FaceLabeling,tag::Int,d::Integer)
get_face_tag_index(labeling::FaceLabeling,tag::String,d::Integer)

Like get_face_tag by provides the index into the array tags instead of the tag stored in tags.

source

GridTopology

Interface

Gridap.Geometry.GridTopologyType
abstract type GridTopology{Dc,Dp}

Abstract type representing the topological information associated with a grid.

The GridTopology interface is defined by overloading the methods:

The GridTopology interface has the following traits

and tested with this function:

source
Gridap.Geometry.OrientationStyleMethod
OrientationStyle(::Type{<:GridTopology}) -> Val{Bool}
OrientationStyle(::GridTopology) -> Val{Bool}

Val{true}() if has oriented faces, Val{false}() otherwise (default).

source
Gridap.Geometry.RegularityStyleMethod
RegularityStyle(::Type{<:GridTopology}) -> Val{Bool}
RegularityStyle(::GridTopology) -> Val{Bool}

Val{true}() if no hanging-faces (refault), Val{false}() otherwise.

source
Gridap.Integration.num_point_dimsMethod
num_point_dims(::Quadrature{D}) where D
num_point_dims(::Type{<:Quadrature{D}}) where D
source
num_point_dims(::GridTopology) -> Int
num_point_dims(::Type{<:GridTopology}) -> Int
source
num_point_dims(::Triangulation) -> Int
num_point_dims(::Type{<:Triangulation}) -> Int
source
Gridap.Integration.num_dimsMethod
num_dims(::Quadrature{D}) where D where D
num_dims(::Type{<:Quadrature{D}}) where D
source
num_dims(::GridTopology) -> Int
num_dims(::Type{<:GridTopology}) -> Int

Equivalent to num_cell_dims.

source
num_dims(::Triangulation) -> Int
num_dims(::Type{<:Triangulation}) -> Int

Equivalent to num_cell_dims.

source

UnstructuredGridTopology

Gridap.Geometry.UnstructuredGridTopologyMethod
UnstructuredGridTopology(
  vertex_coordinates::Vector{<:Point},
  cell_vertices::Table,
  cell_type::Vector{<:Integer},
  polytopes::Vector{<:Polytope},
  orientation::Val{O}=Val{false}()) where O
source
Gridap.Geometry.UnstructuredGridTopologyMethod
UnstructuredGridTopology(
  vertex_coordinates::Vector{<:Point},
  d_to_dface_vertices::Vector{<:Table},
  cell_type::Vector{<:Integer},
  polytopes::Vector{<:Polytope},
  orientation::Val{O}=Val{false}()) where O
source

DiscreteModels

Interface

Gridap.Geometry.DiscreteModelType
abstract type DiscreteModel{Dc,Dp} <: GridapType

Abstract type holding information about a physical grid, the underlying grid topology, and a labeling of the grid faces. This is the information that typically provides a mesh generator, and it is what one needs to perform a simulation.

The DiscreteModel interface is defined by overloading the methods:

The interface is tested with this function:

source

DiscreteModelFromFile

UnstructuredDiscreteModels

Gridap.Geometry.UnstructuredDiscreteModelType
struct UnstructuredDiscreteModel{Dc,Dp,Tp,B} <: DiscreteModel{Dc,Dp}
  grid::UnstructuredGrid{Dc,Dp,Tp,B}
  grid_topology::UnstructuredGridTopology{Dc,Dp,Tp,B}
  face_labeling::FaceLabeling
end
source

CartesianDiscreteModels

CellFields

CellFieldLike interface

CellField interface

Concrete implementations