Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

fempack.elements

LNCC - Laboratório Nacional de Computação Científica

Interface unificada para elementos finitos Lagrangeanos.

Classes

LagrangeElement

Elemento Lagrange de grau 1 ou 2.

Parâmetros:

Propriedades:

Métodos:

Tipos de Elementos Suportados

Importante: Espaços globais (FunctionSpace) são restritos a grau 1. P2 é usado apenas para experimentos locais 1D e verificação.

Exemplo de Uso

from fempack.elements import LagrangeElement
import numpy as np

# Criar elemento P1 em 1D
element = LagrangeElement(cell_type="interval", degree=1)

# Avaliar funções de forma em pontos
xi = np.array([0.25, 0.5, 0.75])
N = element.tabulate(xi)
print(N.shape)  # (3, 2)

# Criar elemento Q1 para quadrilátero
element_q1 = LagrangeElement(cell_type="square", degree=1)
print(element_q1.dofs_per_cell)  # 4

Veja o código fonte.