Skip to content

Commit dd8b375

Browse files
committed
Merge branch 'develop' of github.com:lanl/artemis into sli/dust
2 parents 22cf399 + bf19cdb commit dd8b375

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+464
-312
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ jobs:
4040
python-version: '3.x' # Specify the Python version you need
4141
- name: Install dependencies
4242
run: |
43+
pip install clang-format==12.0.1.2
4344
pip install black
4445
- name: Run format check
4546
run: |
46-
source env/bash
47-
VERBOSE=1 ./style/format.sh
47+
VERBOSE=1 CFM=clang-format ./style/format.sh
4848
git diff --exit-code --ignore-submodules
4949
5050
cpu:

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ if(ARTEMIS_ENABLE_ASAN)
119119
add_link_options(-fsanitize=address -fsanitize=undefined)
120120
endif()
121121

122+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
123+
# silence sprintf warnings on mac
124+
add_compile_options(-Wno-deprecated-declarations)
125+
endif()
126+
122127
# NOTE(@jonahm): For some reason, order still matters for including
123128
# parthenon and singularity. Likely has to do with project
124129
# includes other than Kokkos. MPI and OpenMP likely culprits.
@@ -186,7 +191,8 @@ set(ARTEMIS_SINGULARITY_INCLUDE_PATHS
186191
${CMAKE_CURRENT_SOURCE_DIR}/external/singularity-eos/utils/variant/include
187192
${CMAKE_CURRENT_SOURCE_DIR}/external/singularity-opac/utils
188193
${CMAKE_CURRENT_SOURCE_DIR}/src
189-
${CMAKE_CURRENT_SOURCE_DIR})
194+
${CMAKE_CURRENT_SOURCE_DIR}
195+
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/generated>)
190196

191197
# Set Jaybenne config options and paths
192198
# NOTE(@pdmullen): For the life of us, we are still not sure why we can't treat

doc/src/physics.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -673,10 +673,7 @@ Specifically, |code|, adds the body force,
673673
.. math::
674674
\rho \frac{D \mathbf{v}}{D t} = \rho \mathbf{g}
675675
676-
To activate external gravity, there must be a ``<gravity>`` node and ``gravity = true`` under the ``<physics>`` node.
677-
The ``<gravity>`` requires setting the parameter ``gm``, typically this is set to ``gm = 1.0``.
678-
In addition to ``gm``, the ``tstart`` and ``tstop`` parameters control when gravity is active.
679-
676+
To activate external gravity, there must be a subnode of ``<gravity>`` (e.g., ``<gravity/point>``) and ``gravity = true`` under the ``<physics>`` node.
680677
The specific model for the gravitational acceleration, :math:`\mathbf{g}`, is controlled by adding the appropriate subnode.
681678
Available options are:
682679

@@ -687,8 +684,6 @@ Available options are:
687684

688685
::
689686

690-
<gravity>
691-
gm = 1.0
692687
<gravity/constant>
693688
gx1 = 0.0
694689
gx2 = 0.0
@@ -703,9 +698,8 @@ Available options are:
703698

704699
::
705700

706-
<gravity>
707-
gm = 1.0
708701
<gravity/point>
702+
mass = 1.0
709703
x = 0.0
710704
y = 0.0
711705
z = 0.0
@@ -721,9 +715,8 @@ Available options are:
721715

722716
::
723717

724-
<gravity>
725-
gm = 1.0 # Binary total GM
726718
<gravity/binary>
719+
mass = 1.0 # Total binary mass
727720
x = 0.0 # Binary x center of mass
728721
y = 0.0 # Binary y center of mass
729722
z = 0.0 # Binary z center of mass
@@ -745,14 +738,11 @@ Available options are:
745738
* ``<gravity/nbody>``
746739

747740
This indicates that the gravitational force will be calculated by the N-body system defined in the ``<nbody>`` input block.
748-
The only parameter required is the ``gm`` parameter.
749-
Note that the total mass of the system defined in the ``<nbody>`` block will be rescaled to ``gm``.
750-
An example input block would thus read:
741+
Unlike the other gravity nodes, ``<gravity/nbody>`` has no parameters. Instead, all parameters live under the ``<nbody>`` node.
742+
To activate nbody gravity, simply add:
751743

752744
::
753745

754-
<gravity>
755-
gm = 1.0
756746
<gravity/nbody>
757747

758748
See `N-Body Dynamics`_ for a description of how to set up the N-body system.

inputs/diffusion/alpha_disk.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,8 @@ beta0 = 0.0
8383
tcyl = .0025
8484
cyl_plaw = -1.0
8585

86-
<gravity>
87-
mass_tot = 1.0
8886
<gravity/point>
87+
mass = 1.0
8988

9089
<problem>
9190
r0 = 1.0

inputs/diffusion/conduction.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dfloor = 1.0e-10
7171
siefloor = 1.0e-15
7272

7373
<gas/conductivity>
74-
type = constant
74+
type = conductivity
7575
cond = 1.0e-1
7676

7777
<gravity/uniform>

inputs/diffusion/gaussian_bump.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ type = constant
8080
nu = 5.0e-3
8181

8282
<gas/conductivity>
83-
type = constant
83+
type = conductivity
8484
cond = 5.0e-3
8585

8686
<problem>

inputs/disk/binary_cyl.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ omega = 1.0
8686
type = alpha
8787
alpha = 1e-3
8888

89-
<gravity>
90-
mass_tot = 1.0
9189
<gravity/binary>
90+
mass = 1.0
9291
q = 1.0e-5
9392
a = 1.0
9493
e = 0.0

inputs/disk/binary_nbody_cyl.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ omega = 1.0
9292
type = alpha
9393
alpha = 1e-3
9494

95-
<gravity>
96-
mass_tot = 1.0
9795
<gravity/nbody>
96+
mtot = 1.0
9897

9998
<nbody>
10099
dt_reb = 0.01

inputs/disk/cb_disk.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ siefloor = 1.0e-6
8181
type = constant
8282
nu = 1e-3
8383

84-
<gravity>
85-
mass_tot = 1.0
8684
<gravity/nbody>
85+
mtot = 1.0
8786

8887
<nbody>
8988
integrator = ias15

inputs/disk/disk_alpha.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,8 @@ siefloor = 1.0e-10
7474
type = alpha
7575
alpha = 1e-2
7676

77-
<gravity>
78-
mass_tot = 1.0
7977
<gravity/point>
78+
mass = 1.0
8079

8180
<cooling>
8281
type = beta

inputs/disk/disk_axi.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ omega = 1.0
8080
type = alpha
8181
alpha = 1e-3
8282

83-
<gravity>
84-
mass_tot = 1.0
8583
<gravity/point>
84+
mass = 1.0
8685

8786
<problem>
8887
r0 = 1.0

inputs/disk/disk_cart.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,8 @@ riemann = hlle
110110
dfloor = 1.0e-10
111111
pfloor = 1.0e-15
112112

113-
<gravity>
114-
mass_tot = 1.0
115113
<gravity/point>
114+
mass = 1.0
116115

117116
<problem>
118117
r0 = 1.0

inputs/disk/disk_collision.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ riemann = hllc
7979
dfloor = 1.0e-10
8080
siefloor = 1.0e-10
8181

82-
<gravity>
83-
mass_tot = 1.0
8482
<gravity/nbody>
83+
mtot = 1.0
8584

8685
<gas/damping>
8786
inner_x1 = 0.45

inputs/disk/disk_cyl.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,8 @@ omega = 1.0
8181
type = alpha
8282
alpha = 1e-3
8383

84-
<gravity>
85-
mass_tot = 1.0
8684
<gravity/point>
85+
mass = 1.0
8786

8887
<problem>
8988
r0 = 1.0

inputs/disk/disk_nbody_cyl.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ siefloor = 1.0e-10
7878
type = alpha
7979
alpha = 1e-3
8080

81-
<gravity>
82-
mass_tot = 1.0
8381
<gravity/nbody>
8482

8583
<nbody>

inputs/disk/disk_sph.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,8 @@ omega = 1.0
8080
type = alpha
8181
alpha = 1e-3
8282

83-
<gravity>
84-
mass_tot = 1.0
8583
<gravity/point>
84+
mass = 1.0
8685

8786
<problem>
8887
r0 = 1.0

inputs/ssheet/ssheet.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ refine_type = magnitude
7676
refine_thr = 3.0
7777
deref_thr = 0.8
7878

79-
<gravity>
80-
mass_tot = 1.0e-5
8179
<gravity/point>
80+
mass = 1.0e-5
8281
soft = 0.03
8382
x = 0.0
8483
y = 0.0

src/CMakeLists.txt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,15 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
146146
message(STATUS "Standalone mode. Adding artemis executable")
147147
add_executable(artemis main.cpp)
148148
target_link_libraries(artemis PRIVATE artemislib)
149-
add_custom_command(TARGET artemis POST_BUILD
150-
COMMAND ${CMAKE_COMMAND} -E copy
151-
${CMAKE_BINARY_DIR}/rebound/librebound.so
152-
$<TARGET_FILE_DIR:artemis>)
149+
150+
# Bake in rpath to rebound on mac
151+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
152+
set_target_properties(artemis PROPERTIES
153+
BUILD_RPATH "${CMAKE_BINARY_DIR}/rebound"
154+
)
155+
add_custom_command(TARGET artemis POST_BUILD
156+
COMMAND install_name_tool -add_rpath @executable_path/../rebound $<TARGET_FILE:artemis>
157+
COMMAND install_name_tool -change librebound.so @rpath/librebound.so $<TARGET_FILE:artemis>
158+
)
159+
endif()
153160
endif()

src/artemis.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ Packages_t ProcessPackages(std::unique_ptr<ParameterInput> &pin) {
105105
artemis->AddParam("coord_sys", sys);
106106

107107
// Call package initializers here
108-
if (do_gas) packages.Add(Gas::Initialize(pin.get(), units, constants));
109-
if (do_dust) packages.Add(Dust::Initialize(pin.get()));
110-
if (do_gravity) packages.Add(Gravity::Initialize(pin.get(), constants));
108+
if (do_nbody) packages.Add(NBody::Initialize(pin.get(), constants));
109+
if (do_gravity) packages.Add(Gravity::Initialize(pin.get(), constants, packages));
110+
if (do_gas) packages.Add(Gas::Initialize(pin.get(), units, constants, packages));
111+
if (do_dust) packages.Add(Dust::Initialize(pin.get(), units));
111112
if (do_rotating_frame) packages.Add(RotatingFrame::Initialize(pin.get()));
112113
if (do_cooling) packages.Add(Gas::Cooling::Initialize(pin.get()));
113114
if (do_drag) packages.Add(Drag::Initialize(pin.get()));
114-
if (do_nbody) packages.Add(NBody::Initialize(pin.get(), constants));
115115
if (do_coagulation) {
116116
auto &dustPars = packages.Get("dust")->AllParams();
117117
packages.Add(Dust::Coagulation::Initialize(pin.get(), dustPars, units, constants));

src/artemis_params.yaml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,37 +23,42 @@ artemis:
2323
_type: bool
2424
_default: "false"
2525
_description: "Add user-defined AMR criterion."
26-
units:
27-
_description: "Unit conversions between code and cgs."
2826
physical_units:
2927
_type: "string"
3028
_default: "scalefree"
3129
_description: "What unit system to use for physical units"
32-
code:
30+
scalefree:
3331
_type: opt
3432
_description: "Native code units; no conversions"
3533
cgs:
3634
_type: opt
3735
_description: "CGS unit system"
38-
unit_conversion:
36+
unit_specifier:
3937
_type: "string"
4038
_default: "base"
4139
_description: "How to provide unit conversions between code and physical units"
4240
base:
4341
_type: opt
44-
_description: "Provide base unit conversions (length, time, mass)"
42+
_description: "Provide base unit conversions (length, time, mass, temperature)"
4543
ppd:
4644
_type: opt
4745
_description: "AU, Year/(2 pi), solar mass units for protoplanetary disks"
4846
length:
4947
_type: "Real"
48+
_default: "1.0"
5049
_description: "Physical units value of length equal to 1 code unit"
5150
time:
5251
_type: "Real"
52+
_default: "1.0"
5353
_description: "Physical units value of time equal to 1 code unit"
5454
mass:
5555
_type: "Real"
56+
_default: "1.0"
5657
_description: "Physical units value of mass equal to 1 code unit"
58+
temperature:
59+
_type: "Real"
60+
_default: "1.0"
61+
_description: "Physical units value of temperature equal to 1 code unit"
5762

5863

5964
physics:

src/drag/drag.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ TaskStatus DragSource(MeshData<Real> *md, const Real time, const Real dt) {
110110
auto &gas_pkg = pm->packages.Get("gas");
111111
const auto &dp = gas_pkg->template Param<Diffusion::DiffCoeffParams>("visc_params");
112112
const auto &eos_d = gas_pkg->template Param<EOS>("eos_d");
113-
if (dp.type == Diffusion::DiffType::viscosity_const) {
114-
return SelfDragSourceImpl<Diffusion::DiffType::viscosity_const, GEOM>(
113+
if (dp.type == Diffusion::DiffType::viscosity_plaw) {
114+
return SelfDragSourceImpl<Diffusion::DiffType::viscosity_plaw, GEOM>(
115115
md, time, dt, dp, eos_d, gas_self_par, dust_self_par);
116116
} else if (dp.type == Diffusion::DiffType::viscosity_alpha) {
117117
return SelfDragSourceImpl<Diffusion::DiffType::viscosity_alpha, GEOM>(
@@ -134,13 +134,13 @@ TaskStatus DragSource(MeshData<Real> *md, const Real time, const Real dt) {
134134
drag_pkg->template Param<StoppingTimeParams>("stopping_time_params");
135135
if (gas_self_par.damp_to_visc) {
136136
auto &dp = gas_pkg->template Param<Diffusion::DiffCoeffParams>("visc_params");
137-
if (dp.type == Diffusion::DiffType::viscosity_const) {
137+
if (dp.type == Diffusion::DiffType::viscosity_plaw) {
138138
if (stop_par.model == DragModel::constant) {
139-
return SimpleDragSourceImpl<Diffusion::DiffType::viscosity_const,
139+
return SimpleDragSourceImpl<Diffusion::DiffType::viscosity_plaw,
140140
DragModel::constant, GEOM>(
141141
md, time, dt, dp, eos_d, gas_self_par, dust_self_par, stop_par);
142142
} else if (stop_par.model == DragModel::stokes) {
143-
return SimpleDragSourceImpl<Diffusion::DiffType::viscosity_const,
143+
return SimpleDragSourceImpl<Diffusion::DiffType::viscosity_plaw,
144144
DragModel::stokes, GEOM>(
145145
md, time, dt, dp, eos_d, gas_self_par, dust_self_par, stop_par);
146146
}

0 commit comments

Comments
 (0)