Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Mapped grids#80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
harpolea wants to merge21 commits intomain
base:main
Choose a base branch
Loading
frommapped_grids
Draft
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
21 commits
Select commitHold shift + click to select a range
c14b419
mapped grids
harpoleaFeb 25, 2019
a6fb2b1
mapped grids
harpoleaFeb 25, 2019
9c3270c
mapped grids works with all cartesian metric
harpoleaFeb 26, 2019
3eeb16b
area, line element and rotation matrices can now be passed in
harpoleaFeb 26, 2019
c63321b
added problems to mapped directory
harpoleaFeb 26, 2019
cbbd037
fixed bug so acoustic_pulse now works for rectilinear grids
harpoleaFeb 26, 2019
82b5903
use sympy to calculate area elements
harpoleaFeb 26, 2019
414b266
use sympy to calculate area elements
harpoleaFeb 26, 2019
944389f
mapped grids work with sympy calculating stuff (at least for rectilin…
harpoleaFeb 26, 2019
3583445
made a NullVariables class, added some documentation for the mapped g…
harpoleaFeb 27, 2019
b0f7332
added tests for curvilinear grids
harpoleaFeb 27, 2019
e356ddb
rotation matrix is less broken
harpoleaFeb 28, 2019
6baf2df
finally got it working on non-square grids
harpoleaFeb 28, 2019
28e00ae
fixed rotation matrix so works on non-rectilinear grids as well
harpoleaFeb 28, 2019
8054e6a
fixed tests
harpoleaFeb 28, 2019
632c3b7
switch to computing line and area elements numerically to deal with n…
harpoleaMar 1, 2019
6e05c17
reflect-odd boundary conditions for mapped grids must be rotated
harpoleaMar 1, 2019
7fb135c
moved some function calls outside of loops to speed up problem initia…
harpoleaMar 6, 2019
178ce58
updated tests
harpoleaMar 7, 2019
f73fa35
updated docs
harpoleaMar 7, 2019
bf42bf4
updated mapped grids problems
harpoleaMar 7, 2019
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
PrevPrevious commit
NextNext commit
fixed bug so acoustic_pulse now works for rectilinear grids
  • Loading branch information
@harpolea
harpolea committedFeb 26, 2019
commitcbbd037712113e9cabb2a1c15b73add0c87875a4
24 changes: 12 additions & 12 deletionscompressible_mapped/fluxes.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -81,13 +81,13 @@ def fluxes(my_data, rp, ivars, solid, tc):

for i in range(nx):
for j in range(ny):
U_xl.v(buf=b)[i, j] = (my_data.R_fcy.v(buf=b)[i, j] @
U_xl.v(buf=b)[i, j] = (my_data.R_fcx.v(buf=b)[i, j] @
U.ip(-1, buf=b)[i, j])
U_xr.v(buf=b)[i, j] = (my_data.R_fcy.v(buf=b)[i, j] @
U_xr.v(buf=b)[i, j] = (my_data.R_fcx.v(buf=b)[i, j] @
U.v(buf=b)[i, j])
U_yl.v(buf=b)[i, j] = (my_data.R_fcx.v(buf=b)[i, j] @
U_yl.v(buf=b)[i, j] = (my_data.R_fcy.v(buf=b)[i, j] @
U.jp(-1, buf=b)[i, j])
U_yr.v(buf=b)[i, j] = (my_data.R_fcx.v(buf=b)[i, j] @
U_yr.v(buf=b)[i, j] = (my_data.R_fcy.v(buf=b)[i, j] @
U.v(buf=b)[i, j])

gamma = rp.get_param("eos.gamma")
Expand DownExpand Up@@ -141,25 +141,25 @@ def fluxes(my_data, rp, ivars, solid, tc):
for i in range(ilo - 1, ihi + 1):
for j in range(jlo - 1, jhi + 1):

A_plus_delta_q_x[i, j, :] = myg.gamma_fcy[i, j] * \
(my_data.R_fcy[i, j]).T @ \
A_plus_delta_q_x[i, j, :] = myg.gamma_fcx[i, j] * \
(my_data.R_fcx[i, j]).T @ \
(interface.consFlux(1, gamma, ivars.idens, ivars.ixmom, ivars.iymom,
ivars.iener, ivars.irhox, ivars.naux,
U_xr[i, j, :]) - F_x[i, j, :])
A_minus_delta_q_x[i, j, :] = myg.gamma_fcy[i, j] * \
(my_data.R_fcy[i, j]).T @ \
A_minus_delta_q_x[i, j, :] = myg.gamma_fcx[i, j] * \
(my_data.R_fcx[i, j]).T @ \
(F_x[i, j, :] - interface.consFlux(1, gamma, ivars.idens, ivars.ixmom,
ivars.iymom, ivars.iener,
ivars.irhox, ivars.naux,
U_xl[i, j, :]))

A_plus_delta_q_y[i, j, :] = myg.gamma_fcx[i, j] * \
(my_data.R_fcx[i, j]).T @ \
A_plus_delta_q_y[i, j, :] = myg.gamma_fcy[i, j] * \
(my_data.R_fcy[i, j]).T @ \
(interface.consFlux(2, gamma, ivars.idens, ivars.ixmom, ivars.iymom,
ivars.iener, ivars.irhox, ivars.naux,
U_yr[i, j, :]) - F_y[i, j, :])
A_minus_delta_q_y[i, j, :] = myg.gamma_fcx[i, j] * \
(my_data.R_fcx[i, j]).T @ \
A_minus_delta_q_y[i, j, :] = myg.gamma_fcy[i, j] * \
(my_data.R_fcy[i, j]).T @ \
(F_y[i, j, :] - interface.consFlux(2, gamma, ivars.idens, ivars.ixmom,
ivars.iymom, ivars.iener,
ivars.irhox, ivars.naux,
Expand Down
12 changes: 6 additions & 6 deletionsmesh/mapped.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -144,11 +144,8 @@ def scratch_array(self, nvar=1):
and number of ghostcells as the parent grid
"""

def isTuple(x):
return isinstance(x, tuple)

def flatten(t):
if notisTuple(t):
if notisinstance(t, tuple):
return (t, )
elif len(t) == 0:
return ()
Expand All@@ -158,9 +155,11 @@ def flatten(t):
if nvar == 1:
_tmp = np.zeros((self.qx, self.qy), dtype=np.float64)
else:
_tmp = np.zeros((self.qx, self.qy) + flatten(nvar), dtype=np.float64)
_tmp = np.zeros((self.qx, self.qy) +
flatten(nvar), dtype=np.float64)
return ai.ArrayIndexer(d=_tmp, grid=self)


class MappedCellCenterData2d(CellCenterData2d):

def __init__(self, grid, dtype=np.float64):
Expand All@@ -180,6 +179,7 @@ def make_rotation_matrices(self, ivars):
self.R_fcx = self.grid.R_fcx(ivars.nvar, ivars.ixmom, ivars.iymom)
self.R_fcy = self.grid.R_fcy(ivars.nvar, ivars.ixmom, ivars.iymom)


def mapped_cell_center_data_clone(old):
"""
Create a new CellCenterData2d object that is a copy of an existing
Expand DownExpand Up@@ -215,5 +215,5 @@ def mapped_cell_center_data_clone(old):

new.R_fcx = old.R_fcx.copy()
new.R_fcy = old.R_fcy.copy()

return new

[8]ページ先頭

©2009-2025 Movatter.jp