Skip to content

Commit 436c9d1

Browse files
authored
Merge branch 'AMReX-Codes:development' into development
2 parents 84c5570 + 9a2bff0 commit 436c9d1

File tree

16 files changed

+781
-454
lines changed

16 files changed

+781
-454
lines changed

Docs/sphinx_documentation/source/Basics.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,9 @@ the parser.
669669
parser.registerVariables({"x","y","z"});
670670
auto f = parser.compile<3>(); // 3 because there are three variables.
671671

672-
// f can be used in both host and device code. It takes 3 arguments in
673-
// this example. The parser object must be alive for f to be valid.
672+
// ParserExecutor<3> f is thread-safe, and can be used in both host and
673+
// device code. It takes 3 arguments in this example. The parser object
674+
// must be alive for f to be valid.
674675
for (int k = 0; ...) {
675676
for (int j = 0; ...) {
676677
for (int i = 0; ...) {
@@ -685,8 +686,8 @@ Local automatic variables can be defined in the expression. For example,
685686
686687
::
687688

688-
Parser parser("r2=x*x+y*y; r=sqrt(r2); cos(a+r2)*log(r)"
689-
parser.setConstant(a, ...);
689+
Parser parser("r2=x*x+y*y; r=sqrt(r2); cos(a+r2)*log(r)");
690+
parser.setConstant("a", ...);
690691
parser.registerVariables({"x","y"});
691692
auto f = parser.compile<2>(); // 2 because there are two variables.
692693

Docs/sphinx_documentation/source/EB.rst

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,23 @@ Given an implicit function object, say :cpp:`f`, we can make a
141141
:cpp:`EB2::IndexSpace`
142142
----------------------
143143

144-
We build :cpp:`EB2::IndexSpace` with a template function
144+
We build :cpp:`EB2::IndexSpace` with one of several functions depending
145+
on the application needs.
145146

146-
.. highlight: c++
147+
**Standard Build with Automatic Coarsening**
148+
149+
.. highlight:: c++
147150

148151
::
149152

150153
template <typename G>
151154
void EB2::Build (const G& gshop, const Geometry& geom,
152155
int required_coarsening_level,
153156
int max_coarsening_level,
154-
int ngrow = 4);
157+
int ngrow = 4,
158+
bool build_coarse_level_by_coarsening = true,
159+
bool extend_domain_face = ExtendDomainFace(),
160+
int num_coarsen_opt = NumCoarsenOpt());
155161

156162
Here the template parameter is a :cpp:`EB2::GeometryShop`. :cpp:`Geometry` (see
157163
section :ref:`sec:basics:geom`) describes the rectangular problem domain and the
@@ -173,12 +179,58 @@ ngrow` parameter specifies the number of ghost cells outside the domain on
173179
required levels. For levels coarser than the required level, no EB data are
174180
generated for ghost cells outside the domain.
175181

176-
The newly built :cpp:`EB2::IndexSpace` is pushed on to a stack. Static function
182+
**Build with Explicit Multi-Level Geometry**
183+
184+
For applications requiring explicit control over the geometry at each AMR level:
185+
186+
.. highlight:: c++
187+
188+
::
189+
190+
template <typename G>
191+
void EB2::Build (const G& gshop, Vector<Geometry> geom,
192+
int ngrow = 4,
193+
bool extend_domain_face = ExtendDomainFace(),
194+
int num_coarsen_opt = NumCoarsenOpt());
195+
196+
This version takes a :cpp:`Vector<Geometry>` where each element corresponds to
197+
the geometry of a specific AMR level. The Vector can be unordered, as it will be
198+
sorted based on :cpp:`numPts`.
199+
Unlike the standard :cpp:`Build` function, coarse level EB data is generated
200+
directly from the provided geometries rather than through automatic coarsening.
201+
This is useful when coarse level domains are not simple coarsenings of the fine
202+
level, or when you need precise control over the domain and mesh spacing at each
203+
level.
204+
205+
**Build from STL File**
206+
207+
As mentioned earlier, the EB information can alternatively be initialized from
208+
an STL file using:
209+
210+
.. highlight:: c++
211+
212+
::
213+
214+
void EB2::Build (const Geometry& geom,
215+
int required_coarsening_level,
216+
int max_coarsening_level,
217+
int ngrow = 4,
218+
bool build_coarse_level_by_coarsening = true,
219+
bool extend_domain_face = ExtendDomainFace(),
220+
int num_coarsen_opt = NumCoarsenOpt());
221+
222+
This requires setting :cpp:`ParmParse` parameters ``eb2.geom_type = stl`` and
223+
``eb2.stl_file`` to specify the STL file path.
224+
225+
**Managing IndexSpace Objects**
226+
227+
Regardless of which :cpp:`Build` variant is used, the newly built
228+
:cpp:`EB2::IndexSpace` is pushed on to a stack. Static function
177229
:cpp:`EB2::IndexSpace::top()` returns a :cpp:`const &` to the new
178230
:cpp:`EB2::IndexSpace` object. We usually only need to build one
179231
:cpp:`EB2::IndexSpace` object. However, if your application needs multiple
180232
:cpp:`EB2::IndexSpace` objects, you can save the pointers for later use. For
181-
simplicity, we assume there is only one `EB2::IndexSpace` object for the rest of
233+
simplicity, we assume there is only one :cpp:`EB2::IndexSpace` object for the rest of
182234
this chapter.
183235

184236
EBFArrayBoxFactory

0 commit comments

Comments
 (0)