Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions finat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
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 .bogner_fox_schmit import BognerFoxSchmit # noqa: F401
from .johnson_mercier import JohnsonMercier # noqa: F401
from .mtw import MardalTaiWinther # noqa: F401
from .morley import Morley # noqa: F401
Expand Down
28 changes: 28 additions & 0 deletions finat/bogner_fox_schmit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from finat.physically_mapped import PhysicallyMappedElement, identity
from finat.tensor_product import TensorProductElement
from finat.hermite import Hermite
from functools import reduce
from gem import Product
import numpy


class PhysicallyMappedTensorProductElement(PhysicallyMappedElement, TensorProductElement):

def __init__(self, factors):
TensorProductElement.__init__(self, factors)

def basis_transformation(self, coordinate_mapping=None):
M = []
for f in self.factors:
if isinstance(f, PhysicallyMappedElement):
M.append(f.basis_transformation(coordinate_mapping))
else:
M.append(identity(f.space_dimension()))
return Product(*M)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a tensor product or a matrix product? Seems like it should be the former rather than the latter.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, no. The BFS element has a mixed second derivative, so you probably need to introduce a completion, etc.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the actual mapping cannot be a Kronecker product unless the geometry is always rectangular.



class BognerFoxSchmit(PhysicallyMappedTensorProductElement):

def __init__(self, cell, degree=3):
factors = [Hermite(sub_cell, degree) for sub_cell in cell.product.cells]
super().__init__(factors)
Loading