Broken FEEC projections on polar domains - #576
Conversation
…into polar_splines_alisa
- Remove polar_mapping and use_logical_sol options - Change the analytical solution - Avoid Laplacian() for right hand side - Add disk radius as parse argument
There was a problem hiding this comment.
@alisa-kirkinskaia @campospinto Can you remember why we have no class C1PolarProjection_V2?
Even if it should be identical to C0PolarProjection_V2, for consistency I would at least provide an alias for it, e.g.
C1PolarProjection_V2 = C0PolarProjection_V2A better solution could be to subclass C0PolarProjection_V2, because it allows us to write a dedicated docstring for it:
class C1PolarProjection_V2(C0PolarProjection_V2):
"""
CONGA Projector P2 from the full spline space S^{p1-1, p2-1} on logical
domain to U2, the pre-polar 2-forms splines. The associate matrix
is square, as in the CONGA approach we keep using the tensor B-spline basis,
instead of the polar basis of Toshniwal. P2 enforces coefficient relations
to be in U2.
Parameters:
-----------
W2 : TensorFemSpace
Full tensor product spline space of the 2-forms S^{p1-1, p2-1}
transposed : Boolean
Switch between P2 and P2 transposed (default is False)
"""
def transpose(self, conjugate=False):
return C1PolarProjection_V2(self.W2, transposed=not self.transposed)There is no need to override the other methods, given that they are identical to those of the superclass.
full command is `isort --profile=black psydac/feec/polar`.
No, if I remember correctly the C0 projection was just used in the simulations but this is much cleaner. |
full command is `black psydac/feec/polar`.
Yes, it was because the two projections are the same. I added your suggestion in 5ecf431. Do we also need to add |
Yes, in principle we should test the new class, too. This would be an insurance against future changes to the class. I think we could simply add parametrization to |
Done in 0c0eae0 |
- Move parser definition to a separate function 'parse_input_arguments'; - Import matplotlib and psydac modules in the functions that actually use them.
- Import matplotlib and sympde modules in the functions that actually use them; - Whenever possible, also import sympy and psydac modules in the functions that actually use them.
This allows the correct visualization of the images on the screen of a 14-inch laptop.
Implement broken FEEC projections for C0 and C1 sequences in 2D (conga_projections.py). The formulas for the projections can be found on pages 19-23 of the arXiv preprint https://arxiv.org/pdf/2505.15996.
Main additions
psydac.feec.polar.conga_projections.LinearOperatorsubclassesC0PolarProjection_V0/1/2acting on the coefficients of scalar- or vector-valued tensor-product splines defined on the logical domain. The tensor-product splines are projected onto the subspacesLinearOperatorsubclassesC1PolarProjection_V0/1/2acting on the coefficients of scalar- or vector-valued tensor-product splines defined on the logical domain. The tensor-product splines are projected onto the subspacesdotmethods of the new projection operators correctly execute in parallel for arbitrary domain decompositions in both the angular and radial dimensions.tosparsemethods against reference matrix operatorsdotandtosparsemethodspsydac/feec/polar/examples/poisson_2d.pypsydac/feec/polar/examples/maxwell_2d.pyFurther changes
Additional info
Example of run:
mpirun -n 2 python poisson_2d.py -S -n 16 24 -d 2 2 -t disk -D 0.2 -m 'C0conga'Exact solution, approximate solution and error plot:
Example of run:
mpirun -n 2 python maxwell_2d.py -S -n 16 20 -d 2 2 -T 1 -D 0.2 -s 1Plot of exact solution and approximate solution at final time T = 1:
TODO
C1PolarProjection_V2and test itC1PolarProjection_V0/1/2toC1PolarProjection_U0/1/2(i.e. replaceVwithU)sympy.lambdifywithpyccel.lambdify