Reference
Contents
Index
BEM.AbstractCompressor
BEM.AbstractHMatrix
BEM.AbstractKernelMatrix
BEM.AbstractSplitter
BEM.CardinalitySplitter
BEM.ClusterTree
BEM.ClusterTree
BEM.DHMatrix
BEM.DHMatrix
BEM.GeometricSplitter
BEM.HMatrix
BEM.HMatrix
BEM.HyperRectangle
BEM.KernelMatrix
BEM.MulLinearOp
BEM.PartialACA
BEM.Partition
BEM.PermutedMatrix
BEM.PrincipalComponentSplitter
BEM.RemoteHMatrix
BEM.RkMatrix
BEM.StrongAdmissibilityStd
BEM.TSVD
BEM.VectorOfVectors
BEM.WeakAdmissibilityStd
BEM.kernelH
Base.Matrix
BEM.Bernsteins
BEM.Contato_NL_newton2
BEM.FeD
BEM.Monta_M_RIMd
BEM.Nlinear
BEM._aca_partial
BEM._aca_partial_pivot
BEM._assemble_cpu!
BEM._assemble_hmat_distributed
BEM._assemble_threads!
BEM._build_block_structure!
BEM._cost_gemv
BEM._hgemv_recursive!
BEM._update_frob_norm
BEM.aplica_contato!
BEM.aplica_contato2!
BEM.aplica_contato_incremental!
BEM.aplica_contato_incremental2!
BEM.assemble_hmatrix
BEM.assemble_hmatrix
BEM.binary_split!
BEM.build_sequence_partition
BEM.calcMs
BEM.calc_Aeb
BEM.calc_HeG
BEM.calc_HeG_hiper
BEM.calc_Ti
BEM.calc_Ti
BEM.calc_fforma
BEM.calc_fforma
BEM.calc_fforma_gen
BEM.calc_md
BEM.calsolfund
BEM.calsolfund_hiper
BEM.center
BEM.col_partition
BEM.compress!
BEM.compress!
BEM.compression_ratio
BEM.compression_ratio
BEM.container
BEM.criatensoes
BEM.dBernsteins
BEM.depth
BEM.diameter
BEM.distance
BEM.distance
BEM.elements
BEM.filter_tree
BEM.filter_tree!
BEM.find_optimal_cost
BEM.find_optimal_partition
BEM.getblock!
BEM.getcol!
BEM.glob2loc
BEM.greville
BEM.has_partition
BEM.hilbert_cartesian_to_linear
BEM.hilbert_linear_to_cartesian
BEM.hilbert_partition
BEM.hmul!
BEM.index_range
BEM.integraelem
BEM.integraelem
BEM.integraelem_hiper
BEM.integraelem_hiper_sing
BEM.integraelemd
BEM.isclean
BEM.lagrange
BEM.lagrange
BEM.lagrange
BEM.loc2glob
BEM.newcol!
BEM.nosproximoskmeans
BEM.novelquad
BEM.num_stored_elements
BEM.num_stored_elements
BEM.radius
BEM.reset!
BEM.root_elements
BEM.row_partition
BEM.should_split
BEM.split!
BEM.use_global_index
BEM.use_threads
BEM.verifica_contato
BEM.verifica_contato2
BEM.verifica_contato_incremental
BEM.verifica_contato_incremental2
Base.parent
Base.split
LinearAlgebra.lu
LinearAlgebra.lu!
LinearAlgebra.lu!
LinearAlgebra.mul!
BEM.AbstractCompressor
— Typeabstract type AbstractCompressor
Types used to compress matrices.
BEM.AbstractHMatrix
— Typeabstract type AbstractHMatrix{T} <: AbstractMatrix{T}
Abstract type for hierarchical matrices.
BEM.AbstractKernelMatrix
— Typeabstract 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
.
BEM.AbstractSplitter
— Typeabstract type AbstractSplitter
An AbstractSplitter
is used to split a ClusterTree
. The interface requires the following methods:
should_split(clt,splitter)
: return aBool
determining if theClusterTree
should be further dividedsplit!(clt,splitter)
: perform the splitting of theClusterTree
handling the necessary data sorting.
See GeometricSplitter
for an example of an implementation.
BEM.CardinalitySplitter
— Typestruct 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
BEM.ClusterTree
— TypeClusterTree(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.
BEM.ClusterTree
— Typemutable struct ClusterTree{N,T}
Tree structure used to cluster poitns of type SVector{N,T}
into HyperRectangle
s.
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 ofloc2glob
permutation.children::Vector{ClusterTree{N,T}}
parent::ClusterTree{N,T}
BEM.DHMatrix
— Typemutable 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.
BEM.DHMatrix
— MethodDHMatrix{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.
BEM.GeometricSplitter
— Typestruct GeometricSplitter <: AbstractSplitter
Used to split a ClusterTree
in half along the largest axis. The children boxes are shrank to tighly fit the data.
BEM.HMatrix
— Typemutable struct HMatrix{R,T} <: AbstractHMatrix{T}
A hierarchial matrix constructed from a rowtree
and coltree
of type R
and holding elements of type T
.
BEM.HMatrix
— MethodHMatrix{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.
BEM.HyperRectangle
— Typestruct HyperRectangle{N,T}
Axis-aligned hyperrectangle in N
dimensions given by low_corner::SVector{N,T}
and high_corner::SVector{N,T}
.
BEM.KernelMatrix
— TypeKernelMatrix{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
BEM.MulLinearOp
— Typestruct 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.
BEM.PartialACA
— Typestruct 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.
BEM.Partition
— Typestruct Partition{T}
A partition of the leaves of an HMatrix
. Used to perform threaded hierarchical multiplication.
BEM.PermutedMatrix
— TypePermutedMatrix{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
.
BEM.PrincipalComponentSplitter
— Typestruct PrincipalComponentSplitter <: AbstractSplitter
BEM.RemoteHMatrix
— Typestruct RemoteHMatrix{S,T}
A light wrapper for a Future
storing an HMatrix
.
BEM.RkMatrix
— Typemutable 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.
BEM.StrongAdmissibilityStd
— Typestruct 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)
BEM.TSVD
— Typestruct 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.
BEM.VectorOfVectors
— Typestruct 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!
BEM.WeakAdmissibilityStd
— Typestruct WeakAdmissibilityStd
Two blocks are admissible under this condition if the distance
between them is positive.
BEM.kernelH
— TypeKH=kernelH(dad,BEM.calc_normais(dad))
Base.Matrix
— MethodMatrix(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.
BEM.Bernsteins
— MethodBernsteins(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.
BEM.Contato_NL_newton2
— MethodResolve 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.
BEM.FeD
— MethodA função FeD
calcula duas matrizes, F
e D
, com base nas coordenadas dos nós fornecidos.
Parâmetros
dad
: Estrutura de dadosk
.nodes
: Matrizn x 2
onde cada linha representa as coordenadas(x, y)
de um nó.
Retorno
F
: Matrizn x n
onde cada elementoF[i, j]
é o resultado da funçãointerpola
aplicada à distância entre os nósi
ej
.D
: Matrizn x n
onde cada elementoD[i, j]
é o valor-log(r) / (2 * π * dad.k)
, sendor
a distância entre os nósi
ej
.
Notas
- A função ignora a diagonal principal das matrizes
F
eD
(ondei == j
). - A função
interpola
deve ser definida em outro lugar no código.
BEM.Monta_M_RIMd
— MethodMonta_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:
- Calcula o número de nós (
n_nos
), elementos (nelem
) e nós internos (n_noi
). - Calcula as matrizes de funções radiais
F
e das soluções fundamentaisD
utilizando a funçãoFeD
. - Calcula as matrizes
M
eM1
utilizando a funçãocalcMs
. - Monta a matriz
A
utilizando as matrizesM
,F
eD
. - Ajusta os elementos da diagonal principal de
A
. - Retorna a matriz
A
somada com a matriz diagonalM1
.
BEM.Nlinear
— MethodCalcula as funções de forma lineares contínuas N1 e N2
BEM._aca_partial
— Function_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|.
BEM._aca_partial_pivot
— Method_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.
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.
BEM._assemble_hmat_distributed
— Method_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
.
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.
BEM._build_block_structure!
— Method_build_block_structure!(adm_fun,current_node)
Recursive constructor for HMatrix
block structure. Should not be called directly.
BEM._cost_gemv
— Method_cost_gemv(A::Union{Matrix,SubArray,Adjoint})
A proxy for the computational cost of a matrix/vector product.
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)
.
BEM._update_frob_norm
— Method_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.
BEM.aplica_contato!
— Methodaplica contato com superfície rígida
BEM.aplica_contato2!
— Methodaplica contato 2corpos
BEM.aplica_contato_incremental!
— Methodaplica contato com superfície rígida
BEM.aplica_contato_incremental2!
— Methodaplica contato com superfície rígida
BEM.assemble_hmatrix
— Methodassembel_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.
BEM.assemble_hmatrix
— Methodassemble_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)
.
BEM.binary_split!
— Methodbinary_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.
BEM.build_sequence_partition
— Methodbuild_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
).
BEM.calcMs
— MethodcalcMs(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 constantek
.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.
BEM.calc_Aeb
— Functioncalc_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 serpotencial
ouhelmholtz
.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.
BEM.calc_HeG
— Functioncalc_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)
BEM.calc_HeG_hiper
— Functioncalc_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)
BEM.calc_Ti
— Functioncalc_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:
- Obtém a coordenada do ponto fonte.
- Percorre todos os elementos do contorno.
- Calcula as coordenadas dos nós geométricos do elemento.
- Calcula a transformação de coordenadas e os fatores de forma.
- Realiza a integração dos elementos utilizando a quadratura de Gauss.
- Atualiza o vetor
Ti
com as contribuições de cada elemento.
BEM.calc_Ti
— Functioncalc_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:
- Obtém a coordenada do ponto fonte.
- Percorre todos os elementos do contorno.
- Calcula as coordenadas dos nós geométricos do elemento.
- Calcula a transformação de coordenadas e os fatores de forma.
- Realiza a integração dos elementos utilizando a quadratura de Gauss.
- Atualiza o vetor
Ti
com as contribuições de cada elemento.
BEM.calc_fforma
— Functioncalc_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
fortrue
, retorna uma tupla(N, dN)
ondeN
é o vetor das funções de forma edN
é o vetor das derivadas das funções de forma. - Se
deriv
forfalse
, retorna apenasN
.
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
BEM.calc_fforma
— Methodcalc_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
.
BEM.calc_fforma_gen
— Functioncalc_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
fortrue
, retorna uma tupla(N, dN)
, ondeN
é o vetor das funções de forma edN
é o vetor das derivadas das funções de forma. - Se
deriv
forfalse
, retorna apenasN
.
BEM.calc_md
— Methodcalc_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
.
BEM.calsolfund
— Methodcalsolfund(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 serpotencial
oupotencial_iga
.
Retorno
Retorna a solução fundamental calculada com base nos parâmetros fornecidos.
BEM.calsolfund_hiper
— Methodcalsolfund_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 serpotencial
oupotencial_iga
.
Retorno
Retorna a solução fundamental hipersingular calculada com base nos parâmetros fornecidos.
BEM.center
— Methodcenter(Ω)
Center of the smallest ball containing Ω
.
BEM.col_partition
— Functioncol_partition(H::HMatrix,np,cost)
Similar to hilbert_partition
, but attempts to partition the leaves of H
by column.
BEM.compress!
— Methodcompress!(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))
.
BEM.compress!
— Methodcompress!(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.
BEM.compression_ratio
— Methodcompression_ratio(R::RkMatrix)
The ratio of the uncompressed size of R
to its compressed size in outer product format.
BEM.compression_ratio
— Methodcompression_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.
BEM.container
— Methodcontainer(clt::ClusterTree)
Return the object enclosing all the elements of the clt
.
BEM.criatensoes
— Methodtens_nt, tens= criatensoes(dad, [-1,0,0])
BEM.dBernsteins
— MethoddBernsteins(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 graup
no pontot
.
Exemplo
BEM.depth
— Functiondepth(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).
BEM.diameter
— Methoddiameter(Ω)
Largest distance between x
and y
for x,y ∈ Ω
.
BEM.distance
— Methoddistance(X::ClusterTree, Y::ClusterTree)
Distance between the containers of X
and Y
.
BEM.distance
— Methoddistance(Ω1,Ω2)
Minimal Euclidean distance between a point x ∈ Ω1
and y ∈ Ω2
.
BEM.elements
— Methodelements(clt::ClusterTree)
Iterable list of the elements inside clt
.
BEM.filter_tree
— Functionfilter_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
.
BEM.filter_tree!
— Functionfilter_tree!(filter,nodes,tree,[isterminal=true])
Like filter_tree
, but appends results to nodes
.
BEM.find_optimal_cost
— Functionfind_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
.
BEM.find_optimal_partition
— Functionfind_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.
BEM.getblock!
— Methodgetblock!(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.
BEM.getcol!
— Methodgetcol!(col,M::AbstractMatrix,j)
Fill the entries of col
with column j
of M
.
BEM.glob2loc
— Methodglob2loc(clt::ClusterTree)
The inverse of loc2glob
.
BEM.greville
— Functiongreville(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
BEM.has_partition
— Functionhas_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
.
BEM.hilbert_cartesian_to_linear
— Methodhilbert_cartesian_to_linear(n,x,y)
Convert the cartesian indices x,y
into a linear index d
using a hilbert curve of order n
. The coordinates x,y
range from 0
to n-1
, and the output d
ranges from 0
to n^2-1
.
BEM.hilbert_linear_to_cartesian
— Methodhilbert_linear_to_cartesian(n,d)
Convert the linear index 0 ≤ d ≤ n^2-1
into the cartesian coordinates 0 ≤ x < n-1
and 0 ≤ y ≤ n-1
on the Hilbert curve of order n
.
BEM.hilbert_partition
— Functionhilbert_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.
BEM.hmul!
— Methodhmul!(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.
BEM.index_range
— Methodindex_range(clt::ClusterTree)
Indices of elements in root_elements(clt)
which lie inside clt
.
BEM.integraelem
— MethodFuncao para calcular fazer integracao no contorno
BEM.integraelem
— MethodFunçã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.
BEM.integraelem_hiper
— MethodFunçã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.
BEM.integraelem_hiper_sing
— FunctionFunçã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.
BEM.integraelemd
— MethodFuncao para calcular a das funções de forma
BEM.isclean
— Methodisclean(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.
BEM.lagrange
— Methodlagrange(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)
, ondeni
é o número de pontos na gradepg
.
BEM.lagrange
— Methodlagrange(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)
, ondeni
é o número de pontos na gradepg
.
BEM.lagrange
— Methodlagrange(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
.
BEM.loc2glob
— Methodloc2glob(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.
BEM.newcol!
— Methodnewcol!(A::VectorOfVectors)
Append a new (unitialized) column to A
, and return a view of it.
BEM.nosproximoskmeans
— Functionindc=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
BEM.novelquad
— Functionf-> 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
BEM.num_stored_elements
— Methodnum_stored_elements(R::RkMatrix)
The number of entries stored in the representation. Note that this is not length(R)
.
BEM.num_stored_elements
— Methodnum_stored_elements(H::HMatrix)
The number of entries stored in the representation. Note that this is not length(H)
.
BEM.radius
— Methodradius(Ω)
Half the diameter
.
BEM.reset!
— Methodreset!(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.
BEM.root_elements
— Methodroot_elements(clt::ClusterTree)
The elements contained in the root of the tree to which clt
belongs.
BEM.row_partition
— Functionrow_partition(H::HMatrix,np,cost)
Similar to hilbert_partition
, but attempts to partition the leaves of H
by row.
BEM.should_split
— Functionshould_split(clt::ClusterTree, depth, splitter::AbstractSplitter)
Determine whether or not a ClusterTree
should be further divided.
BEM.split!
— Functionsplit!(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
.
BEM.use_global_index
— Methoduse_global_index()::Bool
Default choice of whether operations will use the global indexing system throughout the package.
BEM.use_threads
— Methoduse_threads()::Bool
Default choice of whether threads will be used throughout the package.
BEM.verifica_contato
— Methodverifica contato com superfície rígida
BEM.verifica_contato2
— Methodverifica contato 2corpos
BEM.verifica_contato_incremental
— Methodverifica contato com superfície rígida
BEM.verifica_contato_incremental2
— Methodverifica contato com superfície rígida
Base.parent
— Methodparent(t::ClusterTree)
The node's parent. If t
is a root, then parent(t)==t
.
Base.split
— Methodsplit(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.
LinearAlgebra.lu!
— Methodlu!(M::HMatrix,comp)
Hierarhical LU facotrization of M
, using comp
to generate the compressed blocks during the multiplication routines.
LinearAlgebra.lu!
— Methodlu!(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.
LinearAlgebra.lu
— MethodLinearAlgebra.lu(M::HMatrix,args...;kwargs...)
Hierarchical LU factorization. See lu!
for the available options.
LinearAlgebra.mul!
— Functionmul!(y::AbstractVector,H::HMatrix,x::AbstractVector,a,b[;global_index,threads])
Perform y <-- H*x*a + y*b
in place.