@@ -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
156162Here the template parameter is a :cpp: `EB2::GeometryShop `. :cpp: `Geometry ` (see
157163section :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
173179required levels. For levels coarser than the required level, no EB data are
174180generated 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
182234this chapter.
183235
184236EBFArrayBoxFactory
0 commit comments