Skip to content

Commit

Permalink
Merge pull request #723 from carlosmunozmoncayo/compile_install_eulerg3d
Browse files Browse the repository at this point in the history
[WIP] Compile and install 3D Euler with gravity example
  • Loading branch information
ketch authored Aug 7, 2024
2 parents 151aefa + d84f2ff commit 05b28dc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
Empty file.
14 changes: 7 additions & 7 deletions examples/euler_gravity_3d/rising_hot_sphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
density (rho), x,y, and z momentum (rho*u,rho*v,rho*w), and energy.
"""
import numpy as np
from mappedGrid import euler3d_mappedgrid as mg
from clawpack.riemann.mappedGrid import euler3d_mappedgrid as mg

try:
from mpi4py import MPI
mpiAvailable = True
except ImportError:
raise ImportError('mpi4py is not available')
import warnings
warnings.warn('mpi4py is not available')
mpiAvailable = False

if mpiAvailable:
Expand Down Expand Up @@ -154,7 +155,7 @@ def euler3d(kernel_language='Fortran',solver_type='classic',\
use_petsc=False,outdir='./_output',\
output_format='hdf5',file_prefix='equil',disable_output=False,\
mx=mxyz[0],my=mxyz[1],mz=mxyz[2],\
tfinal=64.0,num_output_times=1):
tfinal=64.0,num_output_times=1,keep_copy=False):

if use_petsc:
import clawpack.petclaw as pyclaw
Expand All @@ -175,9 +176,8 @@ def euler3d(kernel_language='Fortran',solver_type='classic',\

import logging
solver.logger.setLevel(logging.DEBUG)

import euler_3d_gmap
solver.rp = euler_3d_gmap
from clawpack import riemann
solver.rp = riemann.euler_mapgrid_3D
solver.num_eqn = 5
solver.num_waves = 3
solver.cfl_max = 0.6
Expand Down Expand Up @@ -340,7 +340,7 @@ def euler3d(kernel_language='Fortran',solver_type='classic',\
claw.solver = solver
claw.output_format = output_format
claw.output_file_prefix = file_prefix
claw.keep_copy = False
claw.keep_copy = keep_copy
if disable_output:
claw.output_format = None
claw.tfinal = tfinal
Expand Down
10 changes: 5 additions & 5 deletions examples/euler_gravity_3d/rising_hot_sphere_spherical.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
density (rho), x,y, and z momentum (rho*u,rho*v,rho*w), and energy.
"""
import numpy as np
from mappedGrid import euler3d_mappedgrid as mg
from clawpack.riemann.mappedGrid import euler3d_mappedgrid as mg

# Test for MPI, and set sizes accordingly
try:
from mpi4py import MPI
mpiAvailable = True
except ImportError:
raise ImportError('mpi4py is not available')
import warnings
warnings.warn('mpi4py is not available')
mpiAvailable = False

if mpiAvailable:
Expand Down Expand Up @@ -172,9 +173,8 @@ def euler3d(kernel_language='Fortran',solver_type='classic',\

import logging
solver.logger.setLevel(logging.DEBUG)

import euler_3d_gmap
solver.rp = euler_3d_gmap
from clawpack import riemann
solver.rp = riemann.euler_mapgrid_3D
solver.num_eqn = 5
solver.num_waves = 3
solver.cfl_max = 0.6
Expand Down
1 change: 1 addition & 0 deletions src/pyclaw/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ examples = {
'test_sedov_and_hdf.py',
],
'euler_gravity_3d' : [
'__init__.py',
'plotCreateVisitXDMF.py',
'rising_hot_sphere.py',
'rising_hot_sphere_spherical.py',
Expand Down

0 comments on commit 05b28dc

Please sign in to comment.