11/*
2- * A simplified single file version of the HeatEquation_EX0_C exmaple.
3- * This code is designed to be used with Demo_Tutorial.rst.
4- *
2+ * An AMReX-based version of the StochasticHeat python code:
3+ * Intro FHD paper: https://arxiv.org/abs/2406.12157
4+ * Original python version: https://github.com/AlejGarcia/IntroFHD
55 */
66
77#include " common_functions.H"
@@ -25,6 +25,7 @@ amrex::Initialize(argc,argv);
2525{
2626 // **********************************
2727 // SIMULATION PARAMETERS
28+ // defaults are given here and can be overridden via an inputs files and/or command line
2829
2930 // number of cells in each spatial direction
3031 int n_cell = 32 ;
@@ -96,13 +97,10 @@ amrex::Initialize(argc,argv);
9697 }
9798
9899 // **********************************
99- // Set up simulation grid
100- // make BoxArray and Geometry
101- // ba will contain a list of boxes that cover the domain
102- // geom contains information such as the physical domain size,
103- // number of points in the domain, and periodicity
100+ // Set up simulation grid, which requires a BoxArray and Distribution Mapping
101+ // BoxArray ba will contain a list of boxes that cover the domain
102+ // DistributionMapping dm is a mapping of individual boxes to MPI ranks
104103 BoxArray ba;
105- Geometry geom;
106104
107105 // AMREX_D_DECL means "do the first X of these, where X is the dimensionality of the simulation"
108106 IntVect dom_lo (AMREX_D_DECL ( 0 , 0 , 0 ));
@@ -161,6 +159,8 @@ amrex::Initialize(argc,argv);
161159
162160 // **********************************
163161 // Set up geometry
162+ // geom contains information such as the physical domain size,
163+ // number of points in the domain, and periodicity
164164
165165 Real Length = 2.0e-8 ; // System length (m)
166166 Real Area = std::pow (2.0e-9 ,2 ); // System cross-sectional area (m^2)
@@ -173,6 +173,7 @@ amrex::Initialize(argc,argv);
173173 Array<int ,AMREX_SPACEDIM> is_periodic{AMREX_D_DECL (1 ,1 ,1 )};
174174
175175 // This defines a Geometry object
176+ Geometry geom;
176177 geom.define (domain, real_box, CoordSys::cartesian, is_periodic);
177178
178179 // extract dx from the geometry object
@@ -186,6 +187,7 @@ amrex::Initialize(argc,argv);
186187
187188 // **********************************
188189 // Set physical parameters for the system (iron bar)
190+
189191 Real kB = 1.38e-23 ; // Boltzmann constant (J/K)
190192 Real mAtom = 9.27e-26 ; // Mass of iron atom (kg)
191193 Real rho = 7870 .; // Mass density of iron (kg/m^3)
0 commit comments