Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hog
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hyteg
hog
Commits
b00da3b6
Commit
b00da3b6
authored
10 months ago
by
Nils Kohl
Browse files
Options
Downloads
Patches
Plain Diff
Trying to fix return types of tabulation by going back to returning single-element matrices.
parent
c40aa5ad
Branches
Branches containing commit
Tags
release/0.2.14
Tags containing commit
1 merge request
!24
Parametric mappings
Pipeline
#68478
passed with warnings
10 months ago
Stage: test
Stage: integration
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hog/quadrature/tabulation.py
+3
-9
3 additions, 9 deletions
hog/quadrature/tabulation.py
with
3 additions
and
9 deletions
hog/quadrature/tabulation.py
+
3
−
9
View file @
b00da3b6
...
...
@@ -56,17 +56,14 @@ class Tabulation:
self
.
tables
:
Dict
[
str
,
Table
]
=
{}
def
register_factor
(
self
,
factor_name
:
str
,
factor
:
sp
.
Matrix
|
sp
.
Expr
|
int
|
float
)
->
sp
.
Matrix
|
int
|
float
:
self
,
factor_name
:
str
,
factor
:
sp
.
Matrix
|
int
|
float
)
->
sp
.
Matrix
:
"""
Register a factor of the weak form that can be tabulated. Returns
symbols replacing the expression for the factor. The symbols are returned
in the same form as the factor was given. E.g. in case of a blended full
Stokes operator we might encounter J_F^-1 grad phi being a matrix.
"""
if
isinstance
(
factor
,
(
int
,
float
)):
return
factor
if
isinstance
(
factor
,
sp
.
Expr
):
if
not
isinstance
(
factor
,
sp
.
MatrixBase
):
factor
=
sp
.
Matrix
([
factor
])
if
all
(
f
.
is_constant
()
for
f
in
factor
):
...
...
@@ -80,9 +77,6 @@ class Tabulation:
table
=
self
.
tables
.
setdefault
(
table_name
,
Table
(
table_name
))
replacement_symbols
[
r
,
c
]
=
table
.
insert
(
factor
[
r
,
c
])
if
replacement_symbols
.
shape
==
(
1
,
1
):
replacement_symbols
=
replacement_symbols
[
0
]
return
replacement_symbols
def
construct_tables
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment