Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
efa1387
minor improvements in the calculation of the restriction operator
FrederikSchnack Jun 26, 2025
e9c8c5b
move non_matching_operators to operators, remove obsolete code, move …
FrederikSchnack Jun 26, 2025
108e53d
move content of feec/multipatch/api to api/feec and api/discretization
FrederikSchnack Jun 26, 2025
7ee1a5c
restructure multipatch/operators. Make sure that DiscreteDerhamMultip…
FrederikSchnack Jun 26, 2025
f0b8887
add HodgeOperator to DiscreteDeRhamMultipatch
FrederikSchnack Jun 26, 2025
6ba5ffe
Merge branch 'devel' into improve_fem_api
FrederikSchnack Jun 30, 2025
64e1ae9
remove DiffOperator class and subclass FemLinearOperator instead
FrederikSchnack Jul 9, 2025
2597861
fix typo in linalg/basic
FrederikSchnack Jul 9, 2025
555fcb3
add SparseMatrixLinearOperator
FrederikSchnack Jul 9, 2025
82bbde6
modify multipatch operators and projectors
FrederikSchnack Jul 9, 2025
526d920
add Hodge operators to discrete derham, add option which kind of oper…
FrederikSchnack Jul 9, 2025
7a5c483
update conforming projections and Hodge operators for single patch
FrederikSchnack Jul 10, 2025
3127969
add callable mapping to DiscreteDeRhamMultipatch
FrederikSchnack Jul 14, 2025
0e02d3a
restructured files in psydac/feec/multipatch
FrederikSchnack Jul 14, 2025
44fec73
make conf proj test run
FrederikSchnack Jul 14, 2025
a67d1d9
fix notation in old tests. disable multipatch tests for now
FrederikSchnack Jul 14, 2025
20df3ab
make the conforming projections more consistent
FrederikSchnack Jul 14, 2025
cf877f5
add doc strings to discretize derham multipatch
FrederikSchnack Jul 14, 2025
87e8f2f
fix indentation
FrederikSchnack Jul 14, 2025
a980acc
Merge branch 'devel' into improve_fem_api
FrederikSchnack Jul 14, 2025
b9edf1d
make the multipatch examples run for the tests
FrederikSchnack Jul 15, 2025
c643758
small fix in tests
FrederikSchnack Jul 15, 2025
be9726a
removed plot_dir by accident
FrederikSchnack Jul 15, 2025
5631334
improve projectors interface in DiscreteDeRhamMultipatch
FrederikSchnack Jul 16, 2025
1e45f85
improve docstrings in psydac/api/feec
FrederikSchnack Jul 16, 2025
b88340b
improve docstrings in FemLinearOperators and psydac/feec/derivatives
FrederikSchnack Jul 16, 2025
2ee57ee
remove backend from maxwell source pbm tests
FrederikSchnack Jul 16, 2025
f36a0d3
pass python backend to feec maxwell tests
FrederikSchnack Jul 16, 2025
b4f2ddc
revert changes in tests
FrederikSchnack Jul 16, 2025
05c2531
remove commenteed imports
FrederikSchnack Jul 16, 2025
dbb6167
clean up test file
FrederikSchnack Jul 16, 2025
6163f47
rename _Hodge_kind to _get_Hodge_operator
FrederikSchnack Jul 23, 2025
d1df68b
clarify warning and reduce preservation order
FrederikSchnack Jul 23, 2025
2f8052c
add mom_pres keyword to CP
FrederikSchnack Jul 23, 2025
b20bc2e
fix p_moments if gamma is None
FrederikSchnack Jul 23, 2025
809c317
fix p_moments if gamma is None 2
FrederikSchnack Jul 23, 2025
cf76aa8
clarify warning for reduced order of moment preservation
FrederikSchnack Aug 18, 2025
4872e72
change line breaks
FrederikSchnack Aug 18, 2025
306a853
capitalize DiscreteDeRham
FrederikSchnack Aug 18, 2025
5f4682b
improve csr matrix conversion
FrederikSchnack Aug 18, 2025
61cac85
decapitalize hodges
FrederikSchnack Aug 18, 2025
168ca92
add missing new line at end of file
FrederikSchnack Aug 18, 2025
84a7545
remove the sparse kind
FrederikSchnack Aug 18, 2025
819b5fd
add hodge_operator function
FrederikSchnack Aug 18, 2025
3bd05c2
add NotImplementedError
FrederikSchnack Aug 18, 2025
b0d5a4e
fix typo
FrederikSchnack Aug 18, 2025
0ecfbeb
use a non-sparse lu decomposition to calculate inverse Hodges
FrederikSchnack Aug 18, 2025
df0a5e8
use a non-sparse lu decomposition to calculate inverse Hodges - also …
FrederikSchnack Aug 18, 2025
f1a3abc
rename projectors argument
FrederikSchnack Aug 18, 2025
73ca610
Update psydac/fem/basic.py
FrederikSchnack Aug 18, 2025
3ec07d3
Update psydac/fem/basic.py
FrederikSchnack Aug 18, 2025
bd8953f
Update psydac/fem/basic.py
FrederikSchnack Aug 18, 2025
d0e2baa
Update psydac/fem/basic.py
FrederikSchnack Aug 18, 2025
f6951d6
Update psydac/fem/basic.py
FrederikSchnack Aug 18, 2025
5cce3c6
change docstring
FrederikSchnack Aug 18, 2025
0460a50
add comma and newline
FrederikSchnack Aug 18, 2025
453dcf1
change typo in de Rham
FrederikSchnack Aug 18, 2025
d398934
add newline
FrederikSchnack Aug 18, 2025
7ed8042
remove empty lines
FrederikSchnack Aug 18, 2025
955656e
Update psydac/feec/conforming_projectors.py
FrederikSchnack Aug 18, 2025
9003890
Update psydac/feec/conforming_projectors.py
FrederikSchnack Aug 18, 2025
ec2426c
Update psydac/feec/conforming_projectors.py
FrederikSchnack Aug 18, 2025
5c97438
fix doc strings
FrederikSchnack Aug 18, 2025
07fff48
change projector class names
FrederikSchnack Aug 18, 2025
d1e9dc1
change conforming projector class names
FrederikSchnack Aug 18, 2025
b40bdbd
change derivative class names
FrederikSchnack Aug 18, 2025
72c711b
convert single patch hodge inverse to sparse
FrederikSchnack Aug 18, 2025
e29dbda
update td maxwell example
FrederikSchnack Sep 3, 2025
43cb462
make codacy happy
FrederikSchnack Sep 3, 2025
93002fd
remove block_tostencil
FrederikSchnack Sep 3, 2025
3d136ff
remove sparse_matrix as property of FemLinearOperator and Hodge
FrederikSchnack Sep 8, 2025
aa8c192
adapt test
FrederikSchnack Sep 8, 2025
4a5733f
remove load_dir
FrederikSchnack Sep 8, 2025
531a46a
Merge branch 'devel' into improve_fem_api
FrederikSchnack Sep 11, 2025
751df35
messed up the merge
FrederikSchnack Sep 11, 2025
eec6fb6
calculate hodge inverse iteratively, update test tolerances
FrederikSchnack Sep 11, 2025
57c8e09
reiterate tests
FrederikSchnack Sep 11, 2025
9501ede
update dot of SparseMatrixLinearOperator
FrederikSchnack Sep 15, 2025
5be97d6
add empty line
FrederikSchnack Sep 15, 2025
3ed4ff9
update TD Maxwell example
FrederikSchnack Sep 15, 2025
a16a548
convert cPl to csr
FrederikSchnack Sep 15, 2025
d1a7dd4
actually use the MatrixFree interface
FrederikSchnack Sep 15, 2025
ecaa82f
fix transpose and keyword argument out
FrederikSchnack Sep 15, 2025
124d813
fix bug in MatrixFreeLinearOperator
FrederikSchnack Sep 15, 2025
7eda8c4
make SparseMatrixLinearOperator subclass LinearOperator and move to p…
FrederikSchnack Sep 18, 2025
5e182ff
rename global projectors
FrederikSchnack Sep 18, 2025
cf17f6d
add changed files to auto documentation
FrederikSchnack Sep 18, 2025
06a1dcb
Update psydac/linalg/sparse.py
FrederikSchnack Sep 20, 2025
749ca76
Update psydac/linalg/sparse.py
FrederikSchnack Sep 20, 2025
4c38555
Update psydac/feec/global_geometric_projectors.py
FrederikSchnack Sep 20, 2025
be334b4
Update psydac/feec/conforming_projectors.py
FrederikSchnack Sep 20, 2025
a1dafc7
Update psydac/feec/global_geometric_projectors.py
FrederikSchnack Sep 20, 2025
51ce1ca
Update psydac/feec/multipatch/examples/h1_source_pbms_conga_2d.py
FrederikSchnack Sep 20, 2025
940da2a
Update psydac/feec/multipatch/examples/h1_source_pbms_conga_2d.py
FrederikSchnack Sep 20, 2025
468c945
Update psydac/feec/multipatch/examples/h1_source_pbms_conga_2d.py
FrederikSchnack Sep 20, 2025
980ebc0
Update psydac/feec/multipatch/examples/h1_source_pbms_conga_2d.py
FrederikSchnack Sep 20, 2025
2548979
change signature of discretize_derham_multipatch
FrederikSchnack Sep 20, 2025
9190db6
update docs in conforming projections
FrederikSchnack Sep 20, 2025
8e89187
revert changes in MatrixFreeLinearOperator and fix another typo
FrederikSchnack Sep 20, 2025
86e0f08
add import for assert
FrederikSchnack Sep 20, 2025
f3465f4
add doc string to broken derivatives
FrederikSchnack Sep 20, 2025
a30b8b2
add docstring to SparseMatrixLinearOperator
FrederikSchnack Sep 20, 2025
695142f
revert some changes and fix a missing argument
FrederikSchnack Sep 20, 2025
9c5baa9
use dot_inner
FrederikSchnack Sep 20, 2025
7812d35
Apply suggestions from code review
yguclu Sep 22, 2025
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
5 changes: 0 additions & 5 deletions docs/source/modules/feec.multipatch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ feec.multipatch
:toctree: STUBDIR
:template: autosummary/module.rst

multipatch.api
multipatch.fem_linear_operators
multipatch.multipatch_domain_utilities
multipatch.non_matching_operators
multipatch.operators
multipatch.plotting_utilities
multipatch.utilities
multipatch.utils_conga_2d
4 changes: 3 additions & 1 deletion docs/source/modules/feec.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ feec
:toctree: STUBDIR
:template: autosummary/module.rst

feec.conforming_projectors
feec.derivatives
feec.global_projectors
feec.global_geometric_projectors
feec.hodge
feec.pull_push
feec.pushforward

Expand Down
1 change: 1 addition & 0 deletions docs/source/modules/linalg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ linalg
linalg.kernels
linalg.kron
linalg.solvers
linalg.sparse
linalg.stencil
linalg.topetsc
linalg.utilities
Expand Down
61 changes: 52 additions & 9 deletions psydac/api/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from psydac.api.fem import DiscreteBilinearForm
from psydac.api.fem import DiscreteLinearForm
from psydac.api.fem import DiscreteFunctional
from psydac.api.feec import DiscreteDerham
from psydac.api.feec import DiscreteDeRham, DiscreteDeRhamMultipatch
from psydac.api.glt import DiscreteGltExpr
from psydac.api.expr import DiscreteExpr
from psydac.api.equation import DiscreteEquation
Expand All @@ -47,6 +47,7 @@
__all__ = (
'discretize',
'discretize_derham',
'discretize_derham_multipatch',
'reduce_space_degrees',
'discretize_space',
'discretize_domain'
Expand Down Expand Up @@ -147,10 +148,10 @@ def get_max_degree(*spaces):
#==============================================================================
def discretize_derham(derham, domain_h, *, get_H1vec_space=False, **kwargs):
"""
Create a discrete De Rham sequence from a symbolic one.
Create a discrete de Rham sequence from a symbolic one.

This function creates the discrete spaces from the symbolic ones, and then
creates a DiscreteDerham object from them.
creates a DiscreteDeRham object from them.

Parameters
----------
Expand All @@ -168,18 +169,16 @@ def discretize_derham(derham, domain_h, *, get_H1vec_space=False, **kwargs):

Returns
-------
DiscreteDerham
The discrete De Rham sequence containing the discrete spaces,
DiscreteDeRham
The discrete de Rham sequence containing the discrete spaces,
differential operators and projectors.

See Also
--------
discretize_space

"""

ldim = derham.shape
mapping = domain_h.domain.mapping # NOTE: assuming single-patch domain!
bases = ['B'] + ldim * ['M']
spaces = [discretize_space(V, domain_h, basis=basis, **kwargs)
for V, basis in zip(derham.spaces, bases)]
Expand All @@ -192,7 +191,48 @@ def discretize_derham(derham, domain_h, *, get_H1vec_space=False, **kwargs):
#We still need to specify the symbolic space because of "_recursive_element_of" not implemented in sympde
spaces.append(Xh)

return DiscreteDerham(mapping, *spaces)
return DiscreteDeRham(domain_h, *spaces)

#==============================================================================
def discretize_derham_multipatch(derham, domain_h, **kwargs):
"""
Create a discrete multipatch de Rham sequence from a symbolic one.

This function creates the broken discrete spaces from the symbolic ones, and then
creates a DiscreteDeRhamMultipatch object from them.

Parameters
----------
derham : sympde.topology.space.Derham
The symbolic Derham sequence.

domain_h : Geometry
Discrete domain where the spaces will be discretized.

**kwargs : dict
Optional parameters for the space discretization.

Returns
-------
DiscreteDeRhamMultipatch
The discrete multipatch de Rham sequence containing the discrete spaces,
differential operators and projectors.

See Also
--------
discretize_derham
discretize_space
"""

ldim = derham.shape
bases = ['B'] + ldim * ['M']
spaces = [discretize_space(V, domain_h, basis=basis, **kwargs) \
for V, basis in zip(derham.spaces, bases)]

return DiscreteDeRhamMultipatch(
domain_h = domain_h,
spaces = spaces
)

#==============================================================================
def reduce_space_degrees(V, Vh, *, basis='B', sequence='DR'):
Expand Down Expand Up @@ -631,9 +671,12 @@ def discretize(a, *args, **kwargs):
elif isinstance(a, BasicFunctionSpace):
return discretize_space(a, *args, **kwargs)

elif isinstance(a, Derham):
elif isinstance(a, Derham) and not a.V0.is_broken:
return discretize_derham(a, *args, **kwargs)

elif isinstance(a, Derham) and a.V0.is_broken:
return discretize_derham_multipatch(a, *args, **kwargs)

elif isinstance(a, Domain):
return discretize_domain(a, *args, **kwargs)

Expand Down
Loading