Reference

Contents

Index

BEM.AbstractHMatrixType
abstract type AbstractHMatrix{T} <: AbstractMatrix{T}

Abstract type for hierarchical matrices.

source
BEM.AbstractKernelMatrixType
abstract type AbstractKernelMatrix{T} <: AbstractMatrix{T}

Interface for abstract matrices represented through a kernel function f, target elements X, and source elements Y. The matrix entry i,j is given by f(X[i],Y[j]). Concrete subtypes should implement at least

`Base.getindex(K::AbstractKernelMatrix,i::Int,j::Int)`

If a more efficient implementation of getindex(K,I::UnitRange,I::UnitRange), getindex(K,I::UnitRange,j::Int) and getindex(adjoint(K),I::UnitRange,j::Int) is available (e.g. with SIMD vectorization), implementing such methods can improve the speed of assembling an HMatrix.

source
BEM.AbstractSplitterType
abstract type AbstractSplitter

An AbstractSplitter is used to split a ClusterTree. The interface requires the following methods:

  • should_split(clt,splitter) : return a Bool determining if the ClusterTree should be further divided
  • split!(clt,splitter) : perform the splitting of the ClusterTree handling the necessary data sorting.

See GeometricSplitter for an example of an implementation.

source
BEM.CardinalitySplitterType
struct CardinalitySplitter <: AbstractSplitter

Used to split a ClusterTree along the largest dimension if length(tree)>nmax. The split is performed so the data is evenly distributed amongst all children.

See also: AbstractSplitter

source
BEM.ClusterTreeType
ClusterTree(elements,splitter;[copy_elements=true, threads=false])

Construct a ClusterTree from the given elements using the splitting strategy encoded in splitter. If copy_elements is set to false, the elements argument are directly stored in the ClusterTree and are permuted during the tree construction.

source
BEM.ClusterTreeType
mutable struct ClusterTree{N,T}

Tree structure used to cluster poitns of type SVector{N,T} into HyperRectangles.

Fields:

  • _elements::Vector{SVector{N,T}} : vector containing the sorted elements.
  • container::HyperRectangle{N,T} : container for the elements in the current node.
  • index_range::UnitRange{Int} : indices of elements contained in the current node.
  • loc2glob::Vector{Int} : permutation from the local indexing system to the original (global) indexing system used as input in the construction of the tree.
  • glob2loc::Vector{Int} : inverse of loc2glob permutation.
  • children::Vector{ClusterTree{N,T}}
  • parent::ClusterTree{N,T}
source
BEM.DHMatrixType
mutable struct DHMatrix{R,T} <: AbstractHMatrix{T}

Concrete type representing a hierarchical matrix with data distributed amongst various workers. Its structure is very similar to HMatrix, except that the leaves store a RemoteHMatrix object.

The data on the leaves of a DHMatrix may live on a different worker, so calling fetch on them should be avoided whenever possible.

source
BEM.DHMatrixMethod
DHMatrix{T}(rowtree,coltree;partition_strategy=:distribute_columns)

Construct the block structure of a distributed hierarchical matrix covering rowtree and coltree. Returns a DHMatrix with leaves that are empty.

The partition_strategy keyword argument determines how to partition the blocks for distributed computing. Currently, the only available options is distribute_columns, which will partition the columns of the underlying matrix into floor(log2(nw)) parts, where nw is the number of workers available.

source
BEM.GeometricSplitterType
struct GeometricSplitter <: AbstractSplitter

Used to split a ClusterTree in half along the largest axis. The children boxes are shrank to tighly fit the data.

source
BEM.HMatrixType
mutable struct HMatrix{R,T} <: AbstractHMatrix{T}

A hierarchial matrix constructed from a rowtree and coltree of type R and holding elements of type T.

source
BEM.HMatrixMethod
HMatrix{T}(rowtree,coltree,adm)

Construct an empty HMatrix with rowtree and coltree using the admissibility condition adm. This function builds the skeleton for the hierarchical matrix, but does not compute data field in the blocks. See assemble_hmatrix for assembling a hierarhical matrix.

source
BEM.HyperRectangleType
struct HyperRectangle{N,T}

Axis-aligned hyperrectangle in N dimensions given by low_corner::SVector{N,T} and high_corner::SVector{N,T}.

source
BEM.KernelMatrixType
KernelMatrix{Tf,Tx,Ty,T} <:: AbstractKernelMatrix{T}

Generic kernel matrix representing a kernel function acting on two sets of elements. If K is a KernelMatrix, then K[i,j] = f(X[i],Y[j]) where f::Tf=kernel(K), X::Tx=rowelements(K) and Y::Ty=colelements(K).

Examples

X = rand(SVector{2,Float64},2)
Y = rand(SVector{2,Float64},2)
K = KernelMatrix(X,Y) do x,y
    sum(x+y)
end
source
BEM.MulLinearOpType
struct MulLinearOp{R,T} <: AbstractMatrix{T}

Abstract matrix representing the following linear operator:

    L = R + P + a * ∑ᵢ Aᵢ * Bᵢ

where R and P are of type RkMatrix{T}, Aᵢ,Bᵢ are of type HMatrix{R,T} and a is scalar multiplier. Calling compressor(L) produces a low-rank approximation of L, where compressor is an AbstractCompressor.

Note: this structure is used to group the operations required when multiplying hierarchical matrices so that they can later be executed in a way that minimizes recompression of intermediate computations.

source
BEM.PartialACAType
struct PartialACA

Adaptive cross approximation algorithm with partial pivoting. This structure can be used to generate an RkMatrix from a matrix-like object M as follows:

using LinearAlgebra
rtol = 1e-6
comp = PartialACA(;rtol)
A = rand(10,2)
B = rand(10,2)
M = A*adjoint(B) # a low-rank matrix
R = comp(M, axes(M)...) # compress the entire matrix `M`
norm(Matrix(R) - M) < rtol*norm(M) # true

# output

true

Because it uses partial pivoting, the linear operator does not have to be evaluated at every i,j. This is usually much faster than TSVD, but due to the pivoting strategy the algorithm may fail in special cases, even when the underlying linear operator is of low rank.

source
BEM.PartitionType
struct Partition{T}

A partition of the leaves of an HMatrix. Used to perform threaded hierarchical multiplication.

source
BEM.PermutedMatrixType
PermutedMatrix{K,T} <: AbstractMatrix{T}

Structured used to reprensent the permutation of a matrix-like object. The original matrix is stored in the data::K field, and the permutations are stored in rowperm and colperm.

source
BEM.RkMatrixType
mutable struct RkMatrix{T}

Representation of a rank r matrix M in outer product format M = A*adjoint(B) where A has size m × r and B has size n × r.

The internal representation stores A and B, but R.Bt or R.At can be used to get the respective adjoints.

source
BEM.StrongAdmissibilityStdType
struct StrongAdmissibilityStd

Two blocks are admissible under this condition if the minimum of their diameter is smaller than eta times the distance between them, where eta::Float64 is a parameter.

Usage:

adm = StrongAdmissibilityStd(;eta=2.0)
adm(Xnode,Ynode)
source
BEM.TSVDType
struct TSVD

Compression algorithm based on a posteriori truncation of an SVD. This is the optimal approximation in Frobenius norm; however, it also tends to be very expensive and thus should be used mostly for "small" matrices.

source
BEM.VectorOfVectorsType
struct VectorOfVectors{T}

A simple structure which behaves as a Vector{Vector{T}} but stores the entries in a contiguous data::Vector{T} field. All vectors in the VectorOfVectors are assumed to be of size m, and there are k of them, meaning this structure can be used to represent a m × k matrix.

Similar to a vector-of-vectors, calling A[i] returns a view to the i-th column.

See also: newcol!

source
BEM.WeakAdmissibilityStdType
struct WeakAdmissibilityStd

Two blocks are admissible under this condition if the distance between them is positive.

source
Base.MatrixMethod
Matrix(H::HMatrix;global_index=true)

Convert H to a Matrix. If global_index=true (the default), the entries are given in the global indexing system (see HMatrix for more information); otherwise the local indexing system induced by the row and columns trees are used.

source
BEM.BernsteinsMethod
Bernsteins(p, t)

Calcula os polinômios de Bernstein para um dado grau p e parâmetro t.

Parâmetros

  • p::Int: Grau do polinômio de Bernstein.
  • t::Float64: Parâmetro no qual o polinômio de Bernstein será avaliado.

Retorno

  • h::Float64: Resultado da avaliação do polinômio de Bernstein.
source
BEM.Contato_NL_newton2Method

Resolve numericamente um problema não-linear com condições de contato utilizando o método de Newton.

Argumentos:

dad: Estrutura de dados
x0: Chute inicial para a solução.
A2: Matriz do BEM
b2: Vetor do BEM
h: variável com as informações sobre o contato
maxiter (opcional): Número máximo de iterações do método de Newton.
tol (opcional): Tolerância para o erro, utilizada como critério de parada.

Retorno:

x: Solução aproximada do problema, ou o último chute se o critério de parada não for satisfeito.
source
BEM.FeDMethod

A função FeD calcula duas matrizes, F e D, com base nas coordenadas dos nós fornecidos.

Parâmetros

  • dad: Estrutura de dados k.
  • nodes: Matriz n x 2 onde cada linha representa as coordenadas (x, y) de um nó.

Retorno

  • F: Matriz n x n onde cada elemento F[i, j] é o resultado da função interpola aplicada à distância entre os nós i e j.
  • D: Matriz n x n onde cada elemento D[i, j] é o valor -log(r) / (2 * π * dad.k), sendo r a distância entre os nós i e j.

Notas

  • A função ignora a diagonal principal das matrizes F e D (onde i == j).
  • A função interpola deve ser definida em outro lugar no código.
source
BEM.Monta_M_RIMdMethod
Monta_M_RIMd(dad::potencial, npg)

Função que monta a matriz M utilizando o DIBEM (Direct interpolation method).

Parâmetros

  • dad::potencial: Estrutura de dados contendo as informações do problema potencial.
  • npg: Número de pontos de Gauss para integração.

Retorno

  • Matriz A resultante da montagem utilizando o método RIMd.

Descrição

A função realiza os seguintes passos:

  1. Calcula o número de nós (n_nos), elementos (nelem) e nós internos (n_noi).
  2. Calcula as matrizes de funções radiais F e das soluções fundamentais D utilizando a função FeD.
  3. Calcula as matrizes M e M1 utilizando a função calcMs.
  4. Monta a matriz A utilizando as matrizes M, F e D.
  5. Ajusta os elementos da diagonal principal de A.
  6. Retorna a matriz A somada com a matriz diagonal M1.
source
BEM.NlinearMethod

Calcula as funções de forma lineares contínuas N1 e N2

source
BEM._aca_partialFunction
_aca_partial(K,irange,jrange,atol,rmax,rtol,istart=1)

Internal function implementing the adaptive cross-approximation algorithm with partial pivoting. The returned R::RkMatrix provides an approximation to K[irange,jrange] which has either rank is expected to satisfy|M - R| < max(atol,rtol*|M|)`, but this inequality may fail to hold due to the various errors involved in estimating the error and |M|.

source
BEM._aca_partial_pivotMethod
_aca_partial_pivot(v,I)

Find in the valid set I the index of the element x ∈ v maximizing its smallest singular value. This is equivalent to minimizing the spectral norm of the inverse of x.

When x is a scalar, this is simply the element with largest absolute value.

This general implementation should work for both scalar as well as tensor-valued kernels; see (https://www.sciencedirect.com/science/article/pii/S0021999117306721)[https://www.sciencedirect.com/science/article/pii/S0021999117306721] for more details.

source
BEM._assemble_cpu!Method
_assemble_cpu!(hmat::HMatrix,K,comp)

Assemble data on the leaves of hmat. The admissible leaves are compressed using the compressor comp. This function assumes the structure of hmat has already been intialized, and therefore should not be called directly. See HMatrix information on constructors.

source
BEM._assemble_hmat_distributedMethod
_assemble_hmat_distributed(K,rtree,ctree;adm=StrongAdmissibilityStd(),comp=PartialACA();global_index=true,threads=false)

Internal methods called after the DHMatrix structure has been initialized in order to construct the HMatrix on each of the leaves of the DHMatrix.

source
BEM._assemble_threads!Method
_assemble_threads!(hmat::HMatrix,K,comp)

Like _assemble_cpu!, but uses threads to assemble the leaves. Note that the threads are spanwned using Threads.@spawn, which means they are spawned on the same worker as the caller.

source
BEM._cost_gemvMethod
_cost_gemv(A::Union{Matrix,SubArray,Adjoint})

A proxy for the computational cost of a matrix/vector product.

source
BEM._hgemv_recursive!Method
_hgemv_recursive!(C,A,B,offset)

Internal function used to compute C[I] <-- C[I] + A*B[J] where I = rowrange(A) - offset[1] and J = rowrange(B) - offset[2].

The offset argument is used on the caller side to signal if the original hierarchical matrix had a pivot other than (1,1).

source
BEM._update_frob_normMethod
_update_frob_norm(acc,A,B)

Given the Frobenius norm of Rₖ = A[1:end-1]*adjoint(B[1:end-1]) in acc, compute the Frobenius norm of Rₖ₊₁ = A*adjoint(B) efficiently.

source
BEM.assemble_hmatrixMethod
assembel_hmatrix(K::AbstractKernelMatrix[; atol, rank, rtol, kwargs...])

Construct an approximation of K as an HMatrix using the partial ACA algorithm for the low rank blocks. The atol, rank, and rtol optional arguments are passed to the PartialACA constructor, and the remaining keyword arguments are forwarded to the main assemble_hmatrix function.

source
BEM.assemble_hmatrixMethod
assemble_hmatrix([T,], K, rowtree, coltree;
    adm=StrongAdmissibilityStd(),
    comp=PartialACA(),
    threads=true,
    distributed=false,
    global_index=true)

Main routine for assembling a hierarchical matrix. The argument K represents the matrix to be approximated, rowtree and coltree are tree structure partitioning the row and column indices, respectively, adm can be called on a node of rowtree and a node of coltree to determine if the block is compressible, and comp is a function/functor which can compress admissible blocks.

It is assumed that K supports getindex(K,i,j), and that comp can be called as comp(K,irange::UnitRange,jrange::UnitRange) to produce a compressed version of K[irange,jrange] in the form of an RkMatrix.

The type paramter T is used to specify the type of the entries of the matrix, by default is inferred from K using eltype(K).

source
BEM.binary_split!Method
binary_split!(cluster::ClusterTree,predicate)

Split a ClusterTree into two, sorting all elements in the process according to predicate. cluster is assigned as parent to each children.

Each point is sorted according to whether f(x) returns true (point sorted on the "left" node) or false (point sorted on the "right" node). At the end a minimal HyperRectangle containing all left/right points is created.

source
BEM.build_sequence_partitionMethod
build_sequence_partition(seq,nq,cost,nmax)

Partition the sequence seq into nq contiguous subsequences with a maximum of cost of nmax per set. Note that if nmax is too small, this may not be possible (see has_partition).

source
BEM.calcMsMethod
calcMs(dad::potencial, npg)

Calcula os valores das matrizes M e M1 para um dado potencial dad utilizando a quadratura de Gauss-Legendre com npg pontos.

Parâmetros

  • dad::potencial: Estrutura contendo os dados do problema, incluindo nós (NOS), pontos internos (pontos_internos), elementos (ELEM) e constante k.
  • npg: Número de pontos de Gauss-Legendre a serem utilizados na quadratura.

Retorno

  • M: Vetor com as integrais das funções radiais calculados para cada ponto fonte.
  • M1: Vetor com as integrais das soluções fundamentais calculados para cada ponto fonte.

Descrição

A função percorre todos os pontos radiais e elementos do problema, calculando os valores das matrizes M e M1 através da função calc_md, que utiliza a quadratura de Gauss-Legendre para integração numérica. Os resultados são acumulados nos vetores M e M1 e retornados ao final da execução.

source
BEM.calc_AebFunction
calc_Aeb(dad::Union{potencial, helmholtz}, npg=8)

Calcula a matriz A e o velor b para os dados fornecidos.

Parâmetros

  • dad::Union{potencial, helmholtz}: Tipo de dado que pode ser potencial ou helmholtz.
  • npg: Número de pontos de Gauss (opcional, padrão é 8).

Retorna

  • A matriz A e o vetor b calculados com base nos parâmetros fornecidos.
source
BEM.calc_HeGFunction
calc_HeG(dad::potencial, npg=8; Pint=false)

Calcula as matrizes H e G para o problema de potencial usando o Método dos Elementos de Contorno (BEM).

Argumentos

  • dad::potencial: Os dados do problema de potencial, que incluem os elementos (ELEM) e nós (NOS).
  • npg::Int=8: O número de pontos de quadratura de Gauss-Legendre a serem usados para a integração numérica.
  • Pint::Bool=false: Uma flag para indicar se deve usar pontos internos (o padrão é falso).

Retornos

  • H::Matrix{Float64}: A matriz H.
  • G::Matrix{Float64}: A matriz G.

Descrição

Esta função calcula as matrizes H e G para um dado problema de potencial usando o Método dos Elementos de Contorno (BEM). Ela itera sobre os pontos fontes e elementos, realiza a integração numérica usando a quadratura de Gauss-Legendre, e preenche as matrizes H e G com os valores computados.

Exemplo

```julia H, G = calc_HeG(dad, 8)

source
BEM.calc_HeG_hiperFunction
calc_HeG_hiper(dad::potencial, npg=8)

Calcula as matrizes H e G hiper-singulares para o problema de potencial usando o Método dos Elementos de Contorno (BEM).

Argumentos

  • dad::potencial: Os dados do problema de potencial, que incluem os elementos (ELEM) e nós (NOS).
  • npg::Int=8: O número de pontos de quadratura de Gauss-Legendre a serem usados para a integração numérica.

Retornos

  • H::Matrix{Float64}: A matriz H hiper-singular.
  • G::Matrix{Float64}: A matriz G hiper-singular.

Descrição

Esta função calcula as matrizes H e G hiper-singulares para um dado problema de potencial usando o Método dos Elementos de Contorno (BEM). Ela itera sobre os pontos fontes e elementos, realiza a integração numérica usando a quadratura de Gauss-Legendre, e preenche as matrizes H e G com os valores computados.

Exemplo

```julia H, G = calc_HeG(dad, 8)

source
BEM.calc_TiFunction
calc_Ti(dad::potencial_iga, T, q, npg = 8)

Calcula a matriz Ti com as temperaturas nos pontos internos para um dado problema de potencial com elementos de contorno isogeométricos.

Parâmetros

  • dad::Union{potencial, helmholtz}: Estrutura contendo os dados do problema, incluindo elementos, nós e pontos internos.
  • T: Vetor de temperaturas nos nós.
  • q: Vetor de fluxos de calor nos nós.
  • npg: Número de pontos de Gauss para a quadratura (padrão é 8).

Retorno

  • Ti: Vetor resultante após a integração dos elementos.

Descrição

A função percorre todos os pontos internos e elementos do contorno, calculando a contribuição de cada elemento para o vetor Ti utilizando a quadratura de Gauss. Para cada ponto interno, a função:

  1. Obtém a coordenada do ponto fonte.
  2. Percorre todos os elementos do contorno.
  3. Calcula as coordenadas dos nós geométricos do elemento.
  4. Calcula a transformação de coordenadas e os fatores de forma.
  5. Realiza a integração dos elementos utilizando a quadratura de Gauss.
  6. Atualiza o vetor Ti com as contribuições de cada elemento.
source
BEM.calc_TiFunction
calc_Ti(dad::Union{potencial, helmholtz}, T, q, npg=8)

Calcula a matriz Ti com as temperaturas nos pontos internos para um dado problema de potencial ou Helmholtz.

Parâmetros

  • dad::Union{potencial, helmholtz}: Estrutura contendo os dados do problema, incluindo elementos, nós e pontos internos.
  • T: Vetor de temperaturas nos nós.
  • q: Vetor de fluxos de calor nos nós.
  • npg: Número de pontos de Gauss para a quadratura (padrão é 8).

Retorno

  • Ti: Vetor resultante após a integração dos elementos.

Descrição

A função percorre todos os pontos internos e elementos do contorno, calculando a contribuição de cada elemento para o vetor Ti utilizando a quadratura de Gauss. Para cada ponto interno, a função:

  1. Obtém a coordenada do ponto fonte.
  2. Percorre todos os elementos do contorno.
  3. Calcula as coordenadas dos nós geométricos do elemento.
  4. Calcula a transformação de coordenadas e os fatores de forma.
  5. Realiza a integração dos elementos utilizando a quadratura de Gauss.
  6. Atualiza o vetor Ti com as contribuições de cada elemento.
source
BEM.calc_fformaFunction
calc_fforma(ξ, elem, deriv = true)

Calcula as funções de forma polinomiais gerais.

Parâmetros

  • ξ: Ponto de avaliação.
  • elem: Estrutura que contém os pontos nodais ξs.
  • deriv: Booleano que indica se a derivada das funções de forma deve ser calculada. O padrão é true.

Retorno

  • Se deriv for true, retorna uma tupla (N, dN) onde N é o vetor das funções de forma e dN é o vetor das derivadas das funções de forma.
  • Se deriv for false, retorna apenas N.

Notas

  • As funções de forma são calculadas usando o interpolador de Lagrange.
  • Se ξ for igual a algum dos pontos nodais ξs, um pequeno valor é adicionado a ξ para evitar divisão por zero.

Exemplo

source
BEM.calc_fformaMethod
calc_fforma(t, elem_j::bezier, w)

Calcula a forma de função para um elemento de Bézier.

Parâmetros

  • t: Ponto de avaliação.
  • elem_j::bezier: Elemento de Bézier.
  • w: Peso associado ao ponto de avaliação.

Retorno

Retorna a forma de função calculada no ponto t para o elemento elem_j com o peso w.

source
BEM.calc_fforma_genFunction
calc_fforma_gen(ξ, ξs, deriv = true)

Calcula as funções de forma gerais para elementos de um método numérico.

Parâmetros

  • ξ: Ponto de avaliação.
  • ξs: Vetor contendo as coordenadas dos nós.
  • deriv: Booleano opcional que indica se a derivada das funções de forma deve ser calculada. O padrão é true.

Retorno

  • Se deriv for true, retorna uma tupla (N, dN), onde N é o vetor das funções de forma e dN é o vetor das derivadas das funções de forma.
  • Se deriv for false, retorna apenas N.
source
BEM.calc_mdMethod
calc_md(x, pf, k, qsi, w, elem)

Calcula o potencial e a sua derivada normal em um ponto fonte pf devido a um elemento elem.

Parâmetros

  • x::Vector{Float64}: Coordenadas dos nós do elemento.
  • pf::Vector{Float64}: Coordenadas do ponto fonte.
  • k::Float64: Coeficiente de condutividade térmica.
  • qsi::Vector{Float64}: Pontos de Gauss para integração.
  • w::Vector{Float64}: Pesos de Gauss para integração.
  • elem: Dados do elemento

Retorna

  • m_el::Float64: Integral no elemento da função de base radial.
  • m_el1::Float64: Integral no elemento da soluçao fundamental.

Descrição

A função calc_md realiza a integração numérica utilizando a técnica dos pontos de Gauss para calcular o potencial e sua derivada normal em um ponto fonte pf devido a um elemento elem. A função utiliza as funções de forma N e suas derivadas dN_geo para interpolar os pontos de Gauss e calcular as distâncias e vetores normais necessários para a integração. O resultado é o potencial m_el e sua derivada normal m_el1 no ponto fonte pf.

source
BEM.calsolfundMethod
calsolfund(r, n prob::Union{potencial,potencial_iga})

Calcula a solução fundamental.

Parâmetros

  • r: Distância radial.
  • n: normal do ponto de integração.
  • prob: Tipo de problema, pode ser potencial ou potencial_iga.

Retorno

Retorna a solução fundamental calculada com base nos parâmetros fornecidos.

source
BEM.calsolfund_hiperMethod
calsolfund_hiper(r, n, nf, prob::Union{potencial,potencial_iga})

Calcula a solução fundamental hipersingular.

Parâmetros

  • r: Distância radial.
  • n: normal do ponto de integração.
  • nf: normal do ponto fonte.
  • prob: Tipo de problema, pode ser potencial ou potencial_iga.

Retorno

Retorna a solução fundamental hipersingular calculada com base nos parâmetros fornecidos.

source
BEM.compress!Method
compress!(M::RkMatrix,tsvd::TSVD)

Recompress the matrix R using a truncated svd of R. The implementation uses the qr-svd strategy to efficiently compute svd(R) when rank(R) ≪ min(size(R)).

source
BEM.compress!Method
compress!(M::Matrix,tsvd::TSVD)

Recompress the matrix M using a truncated svd and output an RkMatrix. The data in M is invalidated in the process.

source
BEM.compression_ratioMethod
compression_ratio(R::RkMatrix)

The ratio of the uncompressed size of R to its compressed size in outer product format.

source
BEM.compression_ratioMethod
compression_ratio(H::HMatrix)

The ratio of the uncompressed size of H to its compressed size. A compression_ratio of 10 means it would have taken 10 times more memory to store H as a dense matrix.

source
BEM.containerMethod
container(clt::ClusterTree)

Return the object enclosing all the elements of the clt.

source
BEM.dBernsteinsMethod
dBernsteins(p, t)

Calcula a derivada das funções de Bernstein de grau p no ponto t.

Parâmetros

  • p::Int: O grau das funções de Bernstein.
  • t::Float64: O ponto no qual a derivada será calculada.

Retorno

  • dB::Vector{Float64}: Um vetor contendo os valores das derivadas das funções de Bernstein de grau p no ponto t.

Exemplo

source
BEM.depthFunction
depth(tree,acc=0)

Recursive function to compute the depth of node in a a tree-like structure.

Overload this function if your structure has a more efficient way to compute depth (e.g. if it stores it in a field).

source
BEM.distanceMethod
distance(X::ClusterTree, Y::ClusterTree)

Distance between the containers of X and Y.

source
BEM.distanceMethod
distance(Ω1,Ω2)

Minimal Euclidean distance between a point x ∈ Ω1 and y ∈ Ω2.

source
BEM.elementsMethod
elements(clt::ClusterTree)

Iterable list of the elements inside clt.

source
BEM.filter_treeFunction
filter_tree(f,tree,isterminal=true)

Return a vector containing all the nodes of tree such that f(node)==true. The argument isterminal can be used to control whether to continue the search on children of nodes for which f(node)==true.

source
BEM.find_optimal_costFunction
find_optimal_cost(seq,nq,cost,tol)

Find an approximation to the cost of an optimal partitioning of seq into nq contiguous segments. The optimal cost is the smallest number cmax such that has_partition(seq,nq,cost,cmax) returns true.

source
BEM.find_optimal_partitionFunction
find_optimal_partition(seq,nq,cost,tol=1)

Find an approximation to the optimal partition seq into nq contiguous segments according to the cost function. The optimal partition is the one which minimizes the maximum cost over all possible partitions of seq into nq segments.

The generated partition is optimal up to a tolerance tol; for integer valued cost, setting tol=1 means the partition is optimal.

source
BEM.getblock!Method
getblock!(block,K,irange,jrange)

Fill block with K[i,j] for i ∈ irange, j ∈ jrange, where block is of size length(irange) × length(jrange).

A default implementation exists which relies on getindex(K,i,j), but this method can be overloaded for better performance if e.g. a vectorized way of computing a block is available.

source
BEM.getcol!Method
getcol!(col,M::AbstractMatrix,j)

Fill the entries of col with column j of M.

source
BEM.grevilleFunction
greville(knots, p, β = 0.0)

Calcula os nós de Greville para uma dada sequência de nós e grau da B-spline.

Parâmetros

  • knots::Vector{Float64}: Vetor contendo a sequência de nós.
  • p::Int: Grau da B-spline.
  • β::Float64: Parâmetro opcional para ajuste dos nós de Greville. O valor padrão é 0.0.

Retorno

  • Vector{Float64}: Vetor contendo os nós de Greville calculados.

Exemplo

source
BEM.has_partitionFunction
has_partition(v,np,cost,cmax)

Given a vector v, determine whether or not a partition into np segments is possible where the cost of each partition does not exceed cmax.

source
BEM.hilbert_partitionFunction
hilbert_partition(H::HMatrix,np,cost)

Partiotion the leaves of H into np sequences of approximate equal cost (as determined by the cost function) while also trying to maximize the locality of each partition.

source
BEM.hmul!Method
hmul!(C::HMatrix,A::HMatrix,B::HMatrix,a,b,compressor)

Similar to mul! : compute C <-- A*B*a + B*b, where A,B,C are hierarchical matrices and compressor is a function/functor used in the intermediate stages of the multiplication to avoid growring the rank of admissible blocks after addition is performed.

source
BEM.index_rangeMethod
index_range(clt::ClusterTree)

Indices of elements in root_elements(clt) which lie inside clt.

source
BEM.integraelemMethod

Função para integrar elementos.

Parâmetros

  • pf: Coordenadas do ponto de fonte.
  • x: Coordenadas dos pontos pertencentes ao elemento.
  • eta: Coordenadas eta dos pontos de integração.
  • w: Pesos dos pontos de integração.
  • elem: Elemento a ser integrado.
  • `dad:: estrutura: Estrutura contendo os dados do problema.

Retorno

  • h: Valor da integral de h no elemento.
  • g: Valor da integral de g no elemento.

Descrição

Esta função realiza a integração dos elementos fornecidos utilizando os pontos de integração e pesos especificados.

source
BEM.integraelem_hiperMethod

Função para integrar elementos considerando a solução fundamental hipersingular.

Parâmetros

  • pf: Coordenadas do ponto de fonte.
  • x: Coordenadas dos pontos pertencentes ao elemento.
  • eta: Coordenadas eta dos pontos de integração.
  • w: Pesos dos pontos de integração.
  • elem: Elemento a ser integrado.
  • `dad:: estrutura: Estrutura contendo os dados do problema.

Retorno

  • h: Valor da integral de h no elemento.
  • g: Valor da integral de g no elemento.

Descrição

Esta função realiza a integração dos elementos fornecidos utilizando os pontos de integração e pesos especificados.

source
BEM.integraelem_hiper_singFunction

Função para integrar elementos singulares considerando a solução fundamental hipersingular.

Parâmetros

  • pf: Coordenadas do ponto de fonte.
  • nf: Normal do ponto de fonte.
  • x: Coordenadas dos pontos pertencentes ao elemento.
  • xi0: Coordenada eta dos ponto singular.
  • elem: Elemento a ser integrado.
  • `dad:: estrutura: Estrutura contendo os dados do problema.
  • npg::Int=20: Número de pontos de quadratura PTVSI a serem usados para a integração numérica.

Retorno

  • h: Valor da integral de h no elemento.
  • g: Valor da integral de g no elemento.

Descrição

Esta função realiza a integração dos elementos singulares.

source
BEM.iscleanMethod
isclean(H::HMatrix)

Return true if all leaves of H have data, and if the leaves are the only nodes containing data. This is the normal state of an ℋ-matrix, but during intermediate stages of a computation data may be associated with non-leaf nodes for convenience.

source
BEM.lagrangeMethod
lagrange(pg, x1, n1, x2, n2)

Calcula a matriz de interpolação de Lagrange para os pontos fornecidos.

Parâmetros

  • pg: Matriz de pontos de grade, onde cada linha representa um ponto e cada coluna representa uma dimensão.
  • x1: Vetor de coordenadas na primeira dimensão.
  • n1: Número de pontos na primeira dimensão.
  • x2: Vetor de coordenadas na segunda dimensão.
  • n2: Número de pontos na segunda dimensão.

Retorno

  • L: Matriz de interpolação de Lagrange de tamanho (ni, n1 * n2), onde ni é o número de pontos na grade pg.
source
BEM.lagrangeMethod
lagrange(pg, x1, n1, x2, n2, x3, n3)

Calcula a matriz de interpolação de Lagrange para os pontos fornecidos.

Parâmetros

  • pg: Matriz de pontos de grade, onde cada linha representa um ponto e cada coluna representa uma dimensão.
  • x1: Vetor de coordenadas na primeira dimensão.
  • n1: Número de pontos na primeira dimensão.
  • x2: Vetor de coordenadas na segunda dimensão.
  • n2: Número de pontos na segunda dimensão.
  • x3: Vetor de coordenadas na terceira dimensão.
  • n3: Número de pontos na terceira dimensão.

Retorno

  • L: Matriz de interpolação de Lagrange de tamanho (ni, n1 * n2 * n3), onde ni é o número de pontos na grade pg.
source
BEM.lagrangeMethod
lagrange(pg, x, n)

Calcula o polinômio interpolador de Lagrange.

Parâmetros

  • pg: Vetor de pontos de interpolação.
  • x: Ponto onde o polinômio será avaliado.
  • n: Número de pontos de interpolação.

Retorno

  • Valor do polinômio interpolador de Lagrange avaliado em x.
source
BEM.loc2globMethod
loc2glob(clt::ClusterTree)

The permutation from the (local) indexing system of the elements of the clt to the (global) indexes used upon the construction of the tree.

source
BEM.newcol!Method
newcol!(A::VectorOfVectors)

Append a new (unitialized) column to A, and return a view of it.

source
BEM.nosproximoskmeansFunction

indc=nosproximoskmeans(X,k=9) qr1=pqrfact(M[:,indc],rtol=1e-8) qr2=pqrfact(:c,qr1.Q,rtol=1e-8) indl=qr2.p[1:size(qr2.Q,1)] A1=M[:,indc] A2=M[indl,indc]divide M[indl,:] M=A1*A2

source
BEM.novelquadFunction

f-> funçao a ser integrada m->ordem da singularidade t->posição da singularidade n->Quantidade de pontos de integração https://link.springer.com/article/10.1007/s10092-021-00446-1 t = 0.3 f1(x) = (1 + x - x^2) / (x - t)^1 f2(x) = (1 + x - x^2) / (x - t)^2 f3(x) = (1 + x - x^2) / (x - t)^3 eta, w = BEM.novelquad(2, (t - 0.5) * 2, 32) F1(x)=-(t^2 - t - 1) log(x - t) - 1/2 x (2 t + x - 2) dot(f1.(eta / 2 .+ 0.5), w) / 2-1.22523041106851637258923008288999 dot(f2.(eta / 2 .+ 0.5), w) / 2+6.42298561774988045927786175929650 dot(f3.(eta / 2 .+ 0.5), w) / 2-2.73546857952209343844408750481721

source
BEM.num_stored_elementsMethod
num_stored_elements(R::RkMatrix)

The number of entries stored in the representation. Note that this is not length(R).

source
BEM.num_stored_elementsMethod
num_stored_elements(H::HMatrix)

The number of entries stored in the representation. Note that this is not length(H).

source
BEM.reset!Method
reset!(A::VectorOfVectors)

Set the number of columns of A to zero, and the number of rows to zero, but does not resize! the underlying data vector.

source
BEM.root_elementsMethod
root_elements(clt::ClusterTree)

The elements contained in the root of the tree to which clt belongs.

source
BEM.should_splitFunction
should_split(clt::ClusterTree, depth, splitter::AbstractSplitter)

Determine whether or not a ClusterTree should be further divided.

source
BEM.split!Function
split!(clt::ClusterTree,splitter::AbstractSplitter)

Divide clt using the strategy implemented by splitter. This function is reponsible of assigning the children and parent fields, as well as of permuting the data of clt.

source
BEM.use_global_indexMethod
use_global_index()::Bool

Default choice of whether operations will use the global indexing system throughout the package.

source
BEM.use_threadsMethod
use_threads()::Bool

Default choice of whether threads will be used throughout the package.

source
Base.parentMethod
parent(t::ClusterTree)

The node's parent. If t is a root, then parent(t)==t.

source
Base.splitMethod
split(rec::HyperRectangle,[axis]::Int,[place])

Split a hyperrectangle in two along the axis direction at the position place. Returns a tuple with the two resulting hyperrectangles.

When no place is given, defaults to splitting in the middle of the axis.

When no axis and no place is given, defaults to splitting along the largest axis.

source
LinearAlgebra.lu!Method
lu!(M::HMatrix,comp)

Hierarhical LU facotrization of M, using comp to generate the compressed blocks during the multiplication routines.

source
LinearAlgebra.lu!Method
lu!(M::HMatrix;atol=0,rank=typemax(Int),rtol=atol>0 ||
rank<typemax(Int) ? 0 : sqrt(eps(Float64)))

Hierarhical LU facotrization of M, using the PartialACA(;atol,rtol;rank) compressor.

source
LinearAlgebra.luMethod
LinearAlgebra.lu(M::HMatrix,args...;kwargs...)

Hierarchical LU factorization. See lu! for the available options.

source
LinearAlgebra.mul!Function
mul!(y::AbstractVector,H::HMatrix,x::AbstractVector,a,b[;global_index,threads])

Perform y <-- H*x*a + y*b in place.

source