Skip to content

Commit

Permalink
Single source of truth (#120)
Browse files Browse the repository at this point in the history
* finat.element_factory

* test_create_fi(n)at_element
  • Loading branch information
pbrubeck authored Dec 20, 2024
1 parent 11dc133 commit 55114ef
Show file tree
Hide file tree
Showing 6 changed files with 710 additions and 58 deletions.
26 changes: 13 additions & 13 deletions FIAT/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
from FIAT.mixed import MixedElement # noqa: F401
from FIAT.restricted import RestrictedElement # noqa: F401
from FIAT.quadrature_element import QuadratureElement # noqa: F401
from FIAT.tensor_product import TensorProductElement # noqa: F401
from FIAT.enriched import EnrichedElement # noqa: F401
from FIAT.nodal_enriched import NodalEnrichedElement # noqa: F401
from FIAT.discontinuous import DiscontinuousElement # noqa: F401

# Import finite element classes
from FIAT.argyris import Argyris
Expand All @@ -24,9 +28,9 @@
from FIAT.christiansen_hu import ChristiansenHu
from FIAT.johnson_mercier import JohnsonMercier
from FIAT.brezzi_douglas_marini import BrezziDouglasMarini
from FIAT.Sminus import TrimmedSerendipityEdge, TrimmedSerendipityFace # noqa: F401
from FIAT.SminusDiv import TrimmedSerendipityDiv # noqa: F401
from FIAT.SminusCurl import TrimmedSerendipityCurl # noqa: F401
from FIAT.Sminus import TrimmedSerendipityEdge, TrimmedSerendipityFace
from FIAT.SminusDiv import TrimmedSerendipityDiv
from FIAT.SminusCurl import TrimmedSerendipityCurl
from FIAT.brezzi_douglas_fortin_marini import BrezziDouglasFortinMarini
from FIAT.discontinuous_lagrange import DiscontinuousLagrange
from FIAT.discontinuous_taylor import DiscontinuousTaylor
Expand Down Expand Up @@ -56,10 +60,6 @@
from FIAT.hu_zhang import HuZhang
from FIAT.mardal_tai_winther import MardalTaiWinther
from FIAT.bubble import Bubble, FacetBubble
from FIAT.tensor_product import TensorProductElement
from FIAT.enriched import EnrichedElement
from FIAT.nodal_enriched import NodalEnrichedElement
from FIAT.discontinuous import DiscontinuousElement
from FIAT.hdiv_trace import HDivTrace
from FIAT.kong_mulder_veldhuizen import KongMulderVeldhuizen
from FIAT.fdm_element import FDMLagrange, FDMDiscontinuousLagrange, FDMQuadrature, FDMBrokenH1, FDMBrokenL2, FDMHermite # noqa: F401
Expand All @@ -76,13 +76,19 @@
"Crouzeix-Raviart": CrouzeixRaviart,
"Discontinuous Lagrange": DiscontinuousLagrange,
"S": Serendipity,
"SminusF": TrimmedSerendipityFace,
"SminusDiv": TrimmedSerendipityDiv,
"SminusE": TrimmedSerendipityEdge,
"SminusCurl": TrimmedSerendipityCurl,
"Brezzi-Douglas-Marini Cube Face": BrezziDouglasMariniCubeFace,
"Brezzi-Douglas-Marini Cube Edge": BrezziDouglasMariniCubeEdge,
"DPC": DPC,
"Discontinuous Taylor": DiscontinuousTaylor,
"Discontinuous Raviart-Thomas": DiscontinuousRaviartThomas,
"Hermite": CubicHermite,
"Hsieh-Clough-Tocher": HsiehCloughTocher,
"QuadraticPowellSabin6": QuadraticPowellSabin6,
"QuadraticPowellSabin12": QuadraticPowellSabin12,
"Alfeld-Sorokina": AlfeldSorokina,
"Arnold-Qin": ArnoldQin,
"Christiansen-Hu": ChristiansenHu,
Expand All @@ -102,12 +108,6 @@
"Nedelec 2nd kind H(curl)": NedelecSecondKind,
"Raviart-Thomas": RaviartThomas,
"Regge": Regge,
"EnrichedElement": EnrichedElement,
"NodalEnrichedElement": NodalEnrichedElement,
"QuadraticPowellSabin6": QuadraticPowellSabin6,
"QuadraticPowellSabin12": QuadraticPowellSabin12,
"TensorProductElement": TensorProductElement,
"BrokenElement": DiscontinuousElement,
"HDiv Trace": HDivTrace,
"Hellan-Herrmann-Johnson": HellanHerrmannJohnson,
"Gopalakrishnan-Lederer-Schoberl 1st kind": GopalakrishnanLedererSchoberlFirstKind,
Expand Down
82 changes: 39 additions & 43 deletions finat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,44 @@
from .fiat_elements import Bernstein # noqa: F401
from .fiat_elements import Bubble, CrouzeixRaviart, DiscontinuousTaylor # noqa: F401
from .fiat_elements import Lagrange, DiscontinuousLagrange, Real # noqa: F401
from .fiat_elements import DPC, Serendipity, BrezziDouglasMariniCubeEdge, BrezziDouglasMariniCubeFace # noqa: F401
from .fiat_elements import TrimmedSerendipityFace, TrimmedSerendipityEdge # noqa: F401
from .fiat_elements import TrimmedSerendipityDiv # noqa: F401
from .fiat_elements import TrimmedSerendipityCurl # noqa: F401
from .fiat_elements import BrezziDouglasMarini, BrezziDouglasFortinMarini # noqa: F401
from .fiat_elements import Nedelec, NedelecSecondKind, RaviartThomas # noqa: F401
from .fiat_elements import HellanHerrmannJohnson, Regge # noqa: F401
from .fiat_elements import GopalakrishnanLedererSchoberlFirstKind # noqa: F401
from .fiat_elements import GopalakrishnanLedererSchoberlSecondKind # noqa: F401
from .fiat_elements import FacetBubble # noqa: F401
from .fiat_elements import KongMulderVeldhuizen # noqa: F401
from .fiat_elements import (Bernstein, Bubble, BrezziDouglasFortinMarini, # noqa: F401
BrezziDouglasMarini, BrezziDouglasMariniCubeEdge, # noqa: F401
BrezziDouglasMariniCubeFace, CrouzeixRaviart, # noqa: F401
DiscontinuousLagrange, DiscontinuousTaylor, DPC, # noqa: F401
FacetBubble, GopalakrishnanLedererSchoberlFirstKind, # noqa: F401
GopalakrishnanLedererSchoberlSecondKind, HellanHerrmannJohnson, # noqa: F401
KongMulderVeldhuizen, Lagrange, Real, Serendipity, # noqa: F401
TrimmedSerendipityCurl, TrimmedSerendipityDiv, # noqa: F401
TrimmedSerendipityEdge, TrimmedSerendipityFace, # noqa: F401
Nedelec, NedelecSecondKind, RaviartThomas, Regge) # noqa: F401

from .argyris import Argyris # noqa: F401
from .aw import ArnoldWinther # noqa: F401
from .aw import ArnoldWintherNC # noqa: F401
from .hz import HuZhang # noqa: F401
from .bell import Bell # noqa: F401
from .bernardi_raugel import BernardiRaugel, BernardiRaugelBubble # noqa: F401
from .hct import HsiehCloughTocher, ReducedHsiehCloughTocher # noqa: F401
from .arnold_qin import ArnoldQin, ReducedArnoldQin # noqa: F401
from .christiansen_hu import ChristiansenHu # noqa: F401
from .alfeld_sorokina import AlfeldSorokina # noqa: F401
from .guzman_neilan import GuzmanNeilanFirstKindH1, GuzmanNeilanSecondKindH1, GuzmanNeilanBubble, GuzmanNeilanH1div # noqa: F401
from .argyris import Argyris # noqa: F401
from .aw import ArnoldWinther, ArnoldWintherNC # noqa: F401
from .hz import HuZhang # noqa: F401
from .bell import Bell # noqa: F401
from .bernardi_raugel import BernardiRaugel, BernardiRaugelBubble # noqa: F401
from .hct import HsiehCloughTocher, ReducedHsiehCloughTocher # noqa: F401
from .arnold_qin import ArnoldQin, ReducedArnoldQin # noqa: F401
from .christiansen_hu import ChristiansenHu # noqa: F401
from .alfeld_sorokina import AlfeldSorokina # noqa: F401
from .guzman_neilan import GuzmanNeilanFirstKindH1, GuzmanNeilanSecondKindH1, GuzmanNeilanBubble, GuzmanNeilanH1div # noqa: F401
from .powell_sabin import QuadraticPowellSabin6, QuadraticPowellSabin12 # noqa: F401
from .hermite import Hermite # noqa: F401
from .johnson_mercier import JohnsonMercier # noqa: F401
from .mtw import MardalTaiWinther # noqa: F401
from .morley import Morley # noqa: F401
from .trace import HDivTrace # noqa: F401
from .direct_serendipity import DirectSerendipity # noqa: F401
from .hermite import Hermite # noqa: F401
from .johnson_mercier import JohnsonMercier # noqa: F401
from .mtw import MardalTaiWinther # noqa: F401
from .morley import Morley # noqa: F401
from .trace import HDivTrace # noqa: F401
from .direct_serendipity import DirectSerendipity # noqa: F401

from .spectral import GaussLobattoLegendre, GaussLegendre, Legendre, IntegratedLegendre, FDMLagrange, FDMQuadrature, FDMDiscontinuousLagrange, FDMBrokenH1, FDMBrokenL2, FDMHermite # noqa: F401
from .tensorfiniteelement import TensorFiniteElement # noqa: F401
from .tensor_product import TensorProductElement # noqa: F401
from .cube import FlattenedDimensions # noqa: F401
from .discontinuous import DiscontinuousElement # noqa: F401
from .enriched import EnrichedElement # noqa: F401
from .hdivcurl import HCurlElement, HDivElement # noqa: F401
from .mixed import MixedElement # noqa: F401
from .nodal_enriched import NodalEnrichedElement # noqa: 401
from .tensorfiniteelement import TensorFiniteElement # noqa: F401
from .tensor_product import TensorProductElement # noqa: F401
from .cube import FlattenedDimensions # noqa: F401
from .discontinuous import DiscontinuousElement # noqa: F401
from .enriched import EnrichedElement # noqa: F401
from .hdivcurl import HCurlElement, HDivElement # noqa: F401
from .mixed import MixedElement # noqa: F401
from .nodal_enriched import NodalEnrichedElement # noqa: F401
from .quadrature_element import QuadratureElement, make_quadrature_element # noqa: F401
from .restricted import RestrictedElement # noqa: F401
from .runtime_tabulated import RuntimeTabulated # noqa: F401
from . import quadrature # noqa: F401
from . import cell_tools # noqa: F401
from .restricted import RestrictedElement # noqa: F401
from .runtime_tabulated import RuntimeTabulated # noqa: F401
from . import quadrature # noqa: F401
from . import cell_tools # noqa: F401
from . import element_factory # noqa: F401
Loading

0 comments on commit 55114ef

Please sign in to comment.