Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nils Brüggemann
pyicon
Commits
8606c173
Commit
8606c173
authored
2 years ago
by
fraserwg
Browse files
Options
Downloads
Patches
Plain Diff
v minor changes
parent
aa5a3c17
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!11
Updates to calculate_xr and addition of tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyicon/pyicon_calc_xr.py
+20
-15
20 additions, 15 deletions
pyicon/pyicon_calc_xr.py
with
20 additions
and
15 deletions
pyicon/pyicon_calc_xr.py
+
20
−
15
View file @
8606c173
...
...
@@ -141,9 +141,9 @@ def convert_tgrid_data(ds_tg, check_previous_conversion=True, set_dim_order=None
return
ds_IcD
def
print_verbose
(
verbose
=
1
,
message
=
""
,
verbose_stage
=
1
):
if
verbose
>=
verbose_stage
:
print
(
message
)
return
if
verbose
>=
verbose_stage
:
print
(
message
)
return
def
xr_crop_tgrid
(
ds_tg
,
ireg_c
,
verbose
=
1
):
"""
Crop a grid file.
...
...
@@ -399,16 +399,19 @@ def xr_edges2cell(ds_IcD, ve, dze, dzc, edge2cell_coeff_cc=None, fixed_vol_norm=
## Mapping between edges and edges
def
xr_calc_edge2edge_viacell_coeff
(
ds_IcD
):
raise
NotImplementedError
()
# FIXME: Continue here
edge2edge_viacell_coeff
=
()
return
edge2edge_viacell_coeff
def
xr_edges2edges_via_cell
(
ds_IcD
,
vn_e
,
dze
=
'
const
'
):
raise
NotImplementedError
()
# FIXME: Continue here
out_vn_e
=
()
return
out_vn_e
def
xr_edges2edges_via_cell
(
ds_IcD
,
vn_e
,
scalar
,
dze
=
'
const
'
):
raise
NotImplementedError
()
# FIXME: Continue here
out_vn_e
=
()
return
out_vn_e
...
...
@@ -449,15 +452,17 @@ def xr_calc_grad(ds_IcD, scalar, grad_coeff=None):
## Curl
#def xr_calc_rot_coeff(ds_IcD):
# rot_coeff = (
#
#def xr_calc_curl(ds_IcD, vector, rot_coeff=None):
# if rot_coeff is None:
# rot_coeff = xr_calc_rot_coeff(ds_IcD)
# curl_of_vector = (
# curl_v = (
# vector.isel(edge=ds_IcD.edges_of_vertex)
# * rot_coeff)
# ).sum(dim=2)
# return curl_of_vector
def
xr_calc_rot_coeff
(
ds_IcD
):
raise
NotImplementedError
()
rot_coeff
=
()
def
xr_calc_curl
(
ds_IcD
,
vector
,
rot_coeff
=
None
):
raise
NotImplementedError
()
if
rot_coeff
is
None
:
rot_coeff
=
xr_calc_rot_coeff
(
ds_IcD
)
curl_of_vector
=
(
curl_v
=
(
vector
.
isel
(
edge
=
ds_IcD
.
edges_of_vertex
)
*
rot_coeff
)
).
sum
(
dim
=
2
)
return
curl_of_vector
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