Repository navigation
Allow coordinate swap in polar CONGA projections - #634
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 32 |
| Duplication | 45 |
🟢 Coverage 9.10% diff coverage
Metric Results Coverage variation Report missing for a73780e1 Diff coverage ✅ 9.10% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (a73780e) Report Missing Report Missing Report Missing Head commit (ac21648) 105150 67348 64.05% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#634) 648 59 9.10% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
The two failing jobs are caused by issue #637, not by your changes. I am going to create a small PR which fixes the issue ASAP, and ask for your review. |
yguclu
left a comment
There was a problem hiding this comment.
Good job! I have a few remarks
Co-authored-by: Yaman Güçlü <yaman.guclu@gmail.com>
…he Poisson example
Import SymPDE objects from sympde.api and refer to the defining SymPDE modules in docstrings in the files changed by #634.
Add the option to swap the order of the radial and angular coordinates to the broken-FEEC conforming projection operators in 2D polar domains, which were introduced in PR #576. The polar CONGA projections in$(x_1, x_2) = (s, \theta)$ . Here we add the keyword $(\theta, s)$ .
psydac/feec/polar/conga_projections.pyassumed the logical coordinates are orderedradial_dim(default0) so the projections also work on spaces built onBackground
Swapping coordinates preserves the physical fields, geometry, and pole. The mapping becomes$F'=F\circ S$ , where $S(\theta,s)=(s,\theta)$ , so $\det DF'=-(\det DF)\circ S$ .
Let$\Pi$ transpose a coefficient array, i.e. map the flat index $i n_\theta + j$ to $j n_s + i$ . Then
Warning: pull-backs and push-forwards implementations are not consistent about the sign of$\det DF$ , see issue #636.
Changes
radial_dim(which can take the value0or1) to all projections. Assert thatW.periodic[radial_dim] is FalseandW.periodic[1 - radial_dim] is True.dot: all regions (pole, rings, inner, outer boundary) are built with the helperpolar_index(radial_dim, radial_index, angular_index).tosparse: assembles in (radial, angular) flat indices as before. Ifradial_dim == 1, it remaps rows and columns at the end withtranspose_flat_index().C0PolarProjection_V1_00/_10/_11become_s_s,_theta_sand_theta_theta, andC1PolarProjection_U1_00/_10become_s_sand_theta_s. The s-component ofcoeff_space[radial_dim], soC0PolarProjection_V1andC1PolarProjection_U1place the blocks at[rdim, rdim],[adim, adim], and[adim, rdim](or[rdim, adim]iftransposed=True).TransposedTargetMappingandTransposedCzarnyMappingtopsydac.feec.multipatch_domain_utilities, used by the examples whenradial_dim == 1.--radial_dim. In the Poisson example,--radial_dim 1is supported by all test cases (disk,target,czarny) with the smooth methodsNone,C0congaandC1conga; it raises aNotImplementedErrorwith the smooth methodspolar-stdandpolar-spec, which rely onpsydac.polar.C1Projector.Tests
Tests are parametrized over
radial_dim. The (θ, s) case usesTransposedPolarMappingfrompsydac.feec.multipatch_domain_utilities. The new filepsydac/feec/tests/test_multipatch_domain_utilities.pychecks thatTransposedPolarMapping,TransposedTargetMappingandTransposedCzarnyMappingequalPolarMapping,TargetMappingandCzarnyMappingwith swapped logical coordinates, and that the determinant of their Jacobian changes sign.