forked from FEniCS/fiat
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fuse element infrastructure #127
Open
indiamai
wants to merge
20
commits into
master
Choose a base branch
from
indiamai/integrate_fuse
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+153
−14
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6573217
First draft of expanding set size to match when unioning
indiamai dc5188a
Change condition of extension
indiamai c75efef
Adapt new coeff construction for vec sets
indiamai dfd1347
select larger of degrees
indiamai 21f1bf1
Add orthonormal requirement
indiamai 3eb0d1a
merge master
indiamai 2c21e27
Merge master
indiamai 2b45bd5
Move finat commits from old branch
indiamai 9b05688
Lint
indiamai 3a7bb5b
Merge master
indiamai 8d1a074
Refactor to deal with single source of truth
indiamai b72cd61
Refactoring
indiamai a89d057
Renaming fuse project (#125)
indiamai ac81474
Address Pablo's comments
indiamai 9420a6d
Lint
indiamai be81de3
Remove final references to India Def
indiamai 2e3ed6c
Add test, small change to spatial dimension management
indiamai 0b593e5
remove fuse dependency
indiamai 263dad1
Modify code to use np.pad
indiamai 3a5b073
Small changes to allow different topologies
indiamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"""Element.""" | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2025 India Marsden | ||
# | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
|
||
from finat.ufl.finiteelementbase import FiniteElementBase | ||
|
||
|
||
class FuseElement(FiniteElementBase): | ||
""" | ||
A finite element defined using FUSE. | ||
|
||
TODO: Need to deal with cases where value shape and reference value shape are different | ||
""" | ||
|
||
def __init__(self, triple, cell=None): | ||
self.triple = triple | ||
if not cell: | ||
cell = self.triple.cell.to_ufl() | ||
|
||
# this isn't really correct | ||
degree = self.triple.spaces[0].degree() | ||
super(FuseElement, self).__init__("IT", cell, degree, None, triple.get_value_shape()) | ||
|
||
def __repr__(self): | ||
return "FiniteElement(%s, %s, (%s, %s, %s), %s)" % ( | ||
repr(self.triple.DOFGenerator), repr(self.triple.cell), repr(self.triple.spaces[0]), repr(self.triple.spaces[1]), repr(self.triple.spaces[2]), "X") | ||
|
||
def __str__(self): | ||
return "<Fuse%sElem on %s>" % (self.triple.spaces[0], self.triple.cell) | ||
|
||
def mapping(self): | ||
if str(self.sobolev_space) == "HCurl": | ||
return "covariant Piola" | ||
elif str(self.sobolev_space) == "HDiv": | ||
return "contravariant Piola" | ||
else: | ||
return "identity" | ||
|
||
def sobolev_space(self): | ||
return self.triple.spaces[1] | ||
|
||
def reconstruct(self, family=None, cell=None, degree=None, quad_scheme=None, variant=None): | ||
return FuseElement(self.triple, cell=cell) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this case works if A and B have the same continuity and degree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess then this function still needs to handle the case where A and B are not discontinuous but don't have the same degree. I haven't encountered this yet but will add it as a note in the function.