GridapROMs.Utils

GridapROMs.Utils.ContributionType
struct Contribution{V}
  values::Tuple{Vararg{V}}
  trians::Tuple{Vararg{Triangulation}}
end

Collection of values corresponding to a set of triangulations. Similarly to DomainContribution, the values can be accessed by indexing the corresponding triangulation.

source
GridapROMs.Utils.FEDomainsType
struct FEDomains{A,B}
  domains_res::A
  domains_jac::B
end

Fields:

  • domains_res: triangulations relative to the residual (nothing by default)
  • domains_jac: triangulations relative to the Jacobian (nothing by default)
source
GridapROMs.Utils.JointDomainsType
struct JointDomains <: TriangulationStyle end

Trait for a FE operator indicating that residuals/Jacobians in this operator should be computed summing the contributions relative to each triangulation as occurs in Gridap

source
GridapROMs.Utils.SplitDomainsType
struct SplitDomains <: TriangulationStyle end

Trait for a FE operator indicating that residuals/Jacobians in this operator should be computed keeping the contributions relative to each triangulation separate

source
GridapROMs.Utils.collect_cell_matrix_for_trianMethod
function collect_cell_matrix_for_trian(
  trial::FESpace,
  test::FESpace,
  a::DomainContribution,
  strian::Triangulation
  ) -> Tuple{Vector{<:Any},Vector{<:Any},Vector{<:Any}}

Computes the cell-wise data needed to assemble a global sparse matrix for a given input triangulation strian

source
GridapROMs.Utils.collect_cell_vector_for_trianMethod
function collect_cell_vector_for_trian(
  test::FESpace,
  a::DomainContribution,
  strian::Triangulation
  ) -> Tuple{Vector{<:Any},Vector{<:Any}}

Computes the cell-wise data needed to assemble a global vector for a given input triangulation strian

source
GridapROMs.Utils.compute_errorMethod
compute_error(
  sol::AbstractArray{T,N},
  sol_approx::AbstractArray{T,N},
  args...
  ) where {T,N} -> Number

Computes the error between sol and sol_approx, by default in the Euclidean norm. A different norm (usually represented by a sparse matrix) can be provided as an argument.

source
GridapROMs.Utils.compute_relative_errorMethod
compute_relative_error(
  sol::AbstractArray{T,N},
  sol_approx::AbstractArray{T,N},
  args...
  ) where {T,N} -> Number

Computes the relative error between sol and sol_approx, by default in the Euclidean norm. A different norm (usually represented by a sparse matrix) can be provided as an argument.

source
GridapROMs.Utils.compute_speedupMethod
compute_speedup(t1::CostTracker,t2::CostTracker) -> Speedup

Computes the speedup the tracker t2 achieves with respect to t1, in time and in memory footprint

source
GridapROMs.Utils.contributionMethod
contribution(f,trians) -> Contribution

Constructor of a Contribution that allows do-block syntax. f is a function such that

values[i] = f(trians[i]) for i...

This constructor first builds the tuple of values, then builds the Contribution object from values and trians

source
GridapROMs.Utils.get_parentMethod
get_parent(t::Triangulation) -> Triangulation

When t is a triangulation view, returns its parent; throws an error when t is not a triangulation view

source
GridapROMs.Utils.is_parentMethod
is_parent(parent::Triangulation,child::Triangulation) -> Bool

Returns true if child is a triangulation view of parent, false otherwise

source
GridapROMs.Utils.order_domainsMethod
order_domains(
  parents::Tuple{Vararg{Triangulation}},
  children::Tuple{Vararg{Triangulation}}
  ) -> Tuple{Vararg{Triangulation}}

Orders the triangulation children in the same way as the triangulation parents

source