-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for calling Particles3D::initialize without gravity
- Loading branch information
Showing
7 changed files
with
153 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#include "../grid/spatial_domain_props.h" | ||
#include "../gravity/grav3D.h" | ||
#include "../grid/grid3D.h" | ||
|
||
SpatialDomainProps SpatialDomainProps::From_Grav3D(Grav3D& grav) | ||
{ | ||
SpatialDomainProps out; | ||
|
||
out.nx_local = grav.nx_local; | ||
out.ny_local = grav.ny_local; | ||
out.nz_local = grav.nz_local; | ||
|
||
out.nx_total = grav.nx_total; | ||
out.ny_total = grav.ny_total; | ||
out.nz_total = grav.nz_total; | ||
|
||
out.dx = grav.dx; | ||
out.dy = grav.dy; | ||
out.dz = grav.dz; | ||
|
||
// Left boundaries of the local domain | ||
out.xMin = grav.xMin; | ||
out.yMin = grav.yMin; | ||
out.zMin = grav.zMin; | ||
|
||
// Right boundaries of the local domain | ||
out.xMax = grav.xMax; | ||
out.yMax = grav.yMax; | ||
out.zMax = grav.zMax; | ||
|
||
return out; | ||
} | ||
|
||
SpatialDomainProps SpatialDomainProps::From_Grid3D(Grid3D& grid, struct Parameters * P) | ||
{ | ||
|
||
SpatialDomainProps out; | ||
|
||
// Set Box Left boundary positions | ||
out.xMin = grid.H.xblocal; // x_min | ||
out.yMin = grid.H.yblocal; // y_min | ||
out.zMin = grid.H.zblocal; // z_min | ||
|
||
// Set Box Right boundary positions | ||
out.xMax = grid.H.xblocal_max; //x_max; | ||
out.yMax = grid.H.yblocal_max; //y_max; | ||
out.zMax = grid.H.zblocal_max; //z_max; | ||
|
||
// Set uniform ( dx, dy, dz ) | ||
out.dx = grid.H.dx; // dx_real; | ||
out.dy = grid.H.dy; // dy_real; | ||
out.dz = grid.H.dz; // dz_real; | ||
|
||
// Set Box Total number of cells | ||
out.nx_total = P->nx; // nx; | ||
out.ny_total = P->ny; // ny; | ||
out.nz_total = P->nz; // nz; | ||
|
||
// Set Box local domain number of cells | ||
out.nx_local = grid.H.nx_real; // nx_real; | ||
out.ny_local = grid.H.ny_real; // ny_real; | ||
out.nz_local = grid.H.nz_real; // nz_real; | ||
return out; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#pragma once | ||
|
||
#include "../global/global.h" | ||
|
||
class Grav3D; | ||
class Grid3D; | ||
struct Parameters; | ||
|
||
/* This is a collection of 15 quantities that appear in 3 other locations throughout the codebase. | ||
* | ||
* The struct primarily exists to simplify the process of copying these values from one place to | ||
* another. (But it may make sense to refactor other parts of the code in terms of this object) | ||
*/ | ||
struct SpatialDomainProps { | ||
// number of cells in the local domain | ||
int nx_local, ny_local, nz_local; | ||
|
||
// total number of cells in the entire (global) domain | ||
int nx_total, ny_total, nz_total; | ||
|
||
// Left boundaries of the local domain | ||
Real xMin, yMin, zMin; | ||
|
||
// Right boundaries of the local domain | ||
Real xMax, yMax, zMax; | ||
|
||
// cell widths | ||
Real dx, dy, dz; | ||
|
||
static SpatialDomainProps From_Grav3D(Grav3D&); | ||
static SpatialDomainProps From_Grid3D(Grid3D&, Parameters* P); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters