Skip to content
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f3f6733
add kernel
jowezarek Sep 26, 2023
e6a8f5d
fix dimension error
jowezarek Sep 26, 2023
59df5a6
Merge branch 'devel' into add_eval_kernel
Mar 6, 2024
6f956d9
update evaluation method
Mar 6, 2024
33eb0bf
use new method in geometry
Mar 6, 2024
7e4e2c8
Merge branch 'devel' into add_eval_kernel
Mar 6, 2024
56c45d8
convert index to tuple to avoid bug
Mar 6, 2024
bca8e40
fix weights
Mar 6, 2024
b7ccd51
other weight bug...
Mar 6, 2024
bcd6c4d
check type before kernels to avoid wrong type
Mar 6, 2024
b74690d
Merge branch 'devel' into add_eval_kernel
yguclu Mar 8, 2024
6871dcd
Improve kernel `eval_field_3d_once`
yguclu Mar 8, 2024
c8c2766
Merge branch 'devel' into add_eval_kernel
yguclu Mar 12, 2024
26c6909
fix access to starts, shifts and pads from the global vector space
Mar 26, 2024
7272623
Merge branch 'add_eval_kernel' of https://github.com/pyccel/psydac in…
Mar 26, 2024
acc86a3
fix allocation of ldim
Mar 26, 2024
244a5a9
Merge branch 'devel' into add_eval_kernel
yguclu Mar 27, 2024
ce99c53
Merge branch 'devel' into add_eval_kernel
yguclu Oct 4, 2024
d6d4617
Fix wrong merge in tensor.py
yguclu Oct 4, 2024
9963fd6
Some cleanup in tensor.py
yguclu Oct 4, 2024
4df5a23
Merge branch 'devel' into add_eval_kernel
yguclu Aug 27, 2025
3d7c3a6
Update fem/tensor.py: vector_space -> coeff_space
yguclu Aug 27, 2025
383e16a
Remove unused 'template' decorator from field_evaluation_kernels.py
yguclu Aug 28, 2025
2830e78
Update psydac.feec.multipatch module list
yguclu Aug 28, 2025
abc3908
Import Psydac in conf.py to avoid subsequent errors
yguclu Aug 28, 2025
3a1079b
Revert "Import Psydac in conf.py to avoid subsequent errors"
yguclu Aug 28, 2025
049c9a6
Install Psydac before building docs
yguclu Aug 28, 2025
9b7d72c
Revert useless change to test_spline_interpolation.py
yguclu Aug 28, 2025
e8c5e71
New function eval_field_nd_once:
yguclu Aug 29, 2025
c571d5e
Implement fast field evaluation kernels in 1/2/3D:
yguclu Aug 29, 2025
03ae122
Add __all__ to psydac.core.field_evaluation_kernels
yguclu Sep 8, 2025
224970c
Verify Jacobian matrix in test_export_nurbs_to_hdf5
yguclu Sep 9, 2025
d691ba5
Reorganize TensorFemSpace class, improve evaluation methods
yguclu Sep 9, 2025
d9498f4
Use new evaluation methods in NurbsMapping
yguclu Sep 9, 2025
267232a
Update unit tests in test_field_evaluation_kernel.py
yguclu Sep 10, 2025
3b0a095
Merge branch 'devel' into add_eval_kernel
yguclu Sep 10, 2025
18c8941
Remove debug code
yguclu Sep 10, 2025
2595d9c
Improve docstrings in FemSpace and FemField
yguclu Sep 10, 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
31 changes: 31 additions & 0 deletions psydac/core/field_evaluation_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,37 @@
# =============================================================================
# Field evaluation functions
# =============================================================================
# -----------------------------------------------------------------------------
# 0: Evaluation of single 3d field at single point
# -----------------------------------------------------------------------------
@template(name='T', types=[float, complex])
def eval_field_3d_once(local_coeffs : 'T[:,:,:]',
local_bases_0: 'float[:]',
local_bases_1: 'float[:]',
local_bases_2: 'float[:]'):
"""
Parameters
----------
local_coeffs: ndarray of floats
Active (local) coefficients of the fields in all directions

local_bases: list of ndarrays
Active (local) 1D-basis functions values at the point of evaluation.
"""
n1, n2, n3 = local_coeffs.shape

res = local_coeffs[0, 0, 0] - local_coeffs[0, 0, 0]
for i1 in range(n1):
for i2 in range(n2):
for i3 in range(n3):
res += (local_coeffs[i1, i2, i3] *
local_bases_0[i1] *
local_bases_1[i2] *
local_bases_2[i3])

return res


# -----------------------------------------------------------------------------
# 1: Regular tensor grid without weight
# -----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions psydac/core/tests/test_field_evaluation_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -642,3 +642,7 @@ def test_pushforwards_hcurl(ldim):
pushforward_3d_hcurl(field_to_push, inv_jacobians, out)

assert np.allclose(expected, out, atol=ATOL, rtol=RTOL)

if __name__ == '__main__':
test_regular_jacobians('bent_pipe.h5', 2)
test_regular_evaluations([np.sort(np.concatenate((np.zeros(3), np.random.random(9), np.ones(3)))) for i in range(2)], 2, [2] * 2,2)
Loading