Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_FArrayBox.H
Go to the documentation of this file.
1
2#ifndef BL_FARRAYBOX_H
3#define BL_FARRAYBOX_H
4#include <AMReX_Config.H>
5
6#include <AMReX_BaseFab.H>
7#include <AMReX_FabConv.H>
8#include <AMReX_FabFactory.H>
9
15namespace amrex {
16
17class FArrayBox;
18
34class FABio // NOLINT(cppcoreguidelines-special-member-functions)
35{
36public:
45 {
48 };
71 enum Format // NOLINT(readability-enum-initial-value)
72 {
76 //
77 // This is set to four so that when reading in an old FAB,
78 // we don't get confused when we see an old FAB_8BITRLE file.
79 //
83 };
98
100 virtual ~FABio () = default;
106 virtual void read (std::istream& is,
107 FArrayBox& fb) const = 0;
115 virtual void write (std::ostream& os,
116 const FArrayBox& fb,
117 int comp,
118 int num_comp) const = 0;
125 virtual void skip (std::istream& is,
126 FArrayBox& f) const = 0;
127
128 virtual void skip (std::istream& is,
129 FArrayBox& f,
130 int nCompToSkip) const = 0;
135 virtual void write_header (std::ostream& os,
136 const FArrayBox& f,
137 int nvar) const;
149 static FABio* read_header (std::istream& is,
150 FArrayBox& f);
151
157 static FABio* read_header (std::istream& is,
158 FArrayBox& f,
159 int compIndex,
160 int& nCompAvailable);
161};
162
163//
164// Our binary FABio type.
165//
167 :
168 public FABio
169{
170public:
173
174 void read (std::istream& is,
175 FArrayBox& fb) const override;
176
177 void write (std::ostream& os,
178 const FArrayBox& fb,
179 int comp,
180 int num_comp) const override;
181
182 void skip (std::istream& is,
183 FArrayBox& f) const override;
184
185 void skip (std::istream& is,
186 FArrayBox& f,
187 int nCompToSkip) const override;
188
189private:
190 void write_header (std::ostream& os,
191 const FArrayBox& f,
192 int nvar) const override;
193
194 std::unique_ptr<RealDescriptor> realDesc;
195};
196
235 :
236 public BaseFab<Real>
237{
239 friend class FABio;
240public:
242 FArrayBox () noexcept = default;
243
245 explicit FArrayBox (Arena* ar) noexcept;
246
248 FArrayBox (const Box& b, int ncomp, Arena* ar);
249
255 explicit FArrayBox (const Box& b,
256 int ncomp=1,
257 bool alloc=true,
258 bool shared=false,
259 Arena* ar = nullptr);
260
270 FArrayBox (const FArrayBox& rhs, MakeType make_type, int scomp, int ncomp);
271
276 FArrayBox (const Box& b, int ncomp, Real const* p) noexcept;
277
279 FArrayBox (const Box& b, int ncomp, Real* p) noexcept;
280
281 explicit FArrayBox (Array4<Real> const& a) noexcept : BaseFab<Real>(a) {}
282
283 FArrayBox (Array4<Real> const& a, IndexType t) noexcept : BaseFab<Real>(a,t) {}
284
285 explicit FArrayBox (Array4<Real const> const& a) noexcept : BaseFab<Real>(a) {}
286
287 explicit FArrayBox (Array4<Real const> const& a, IndexType t) noexcept : BaseFab<Real>(a,t) {}
288
290 ~FArrayBox () noexcept override = default;
291
293 FArrayBox (FArrayBox&& rhs) noexcept = default;
295 FArrayBox& operator= (FArrayBox&&) noexcept = default;
296
297 FArrayBox (const FArrayBox&) = delete;
298 FArrayBox& operator= (const FArrayBox&) = delete;
299
301 template <RunOn run_on AMREX_DEFAULT_RUNON>
302 FArrayBox& operator= (Real v) noexcept;
303
312 template <RunOn run_on AMREX_DEFAULT_RUNON>
313 [[nodiscard]] bool contains_nan () const noexcept;
314
322 template <RunOn run_on AMREX_DEFAULT_RUNON>
323 [[nodiscard]] bool contains_nan (const Box& bx, int scomp, int ncomp) const noexcept;
324
333 template <RunOn run_on AMREX_DEFAULT_RUNON>
334 bool contains_nan (IntVect& where) const noexcept;
335
348 template <RunOn run_on AMREX_DEFAULT_RUNON>
349 bool contains_nan (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept;
350
359 template <RunOn run_on AMREX_DEFAULT_RUNON>
360 [[nodiscard]] bool contains_inf () const noexcept;
361
369 template <RunOn run_on AMREX_DEFAULT_RUNON>
370 [[nodiscard]] bool contains_inf (const Box& bx, int scomp, int ncomp) const noexcept;
371
380 template <RunOn run_on AMREX_DEFAULT_RUNON>
381 bool contains_inf (IntVect& where) const noexcept;
382
395 template <RunOn run_on AMREX_DEFAULT_RUNON>
396 bool contains_inf (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept;
397
399 void resize (const Box& b, int N = 1, Arena* ar = nullptr);
400
402 [[nodiscard]] FabType getType () const noexcept { return m_type; }
403
404 void initVal () noexcept; // public for cuda
405
407 friend std::ostream& operator<< (std::ostream& os, const FArrayBox& fb);
409 friend std::istream& operator>> (std::istream& is, FArrayBox& fb);
414 void writeOn (std::ostream& os) const;
415
427 void writeOn (std::ostream& os,
428 int comp,
429 int num_comp=1) const;
430
432 void readFrom (std::istream& is);
433
441 int readFrom (std::istream& is, int compIndex);
442
448 static Box skipFAB (std::istream& is,
449 int& num_comp);
450
452 static void skipFAB (std::istream& is);
453
461 static void setFormat (FABio::Format fmt);
462
464 static FABio::Format getFormat ();
465
477 static void setOrdering (FABio::Ordering ordering);
478
484 static FABio::Ordering getOrdering ();
485
490 static void setPrecision (FABio::Precision precision);
491
497 static FABio::Precision getPrecision ();
498
500 static const FABio& getFABio ();
501
506 static void setFABio (FABio* rd);
507
509 static std::unique_ptr<RealDescriptor> getDataDescriptor ();
510
512 static std::string getClassName ();
513
515 static bool set_do_initval (bool tf);
517 static bool get_do_initval ();
519 static Real set_initval (Real iv);
521 static Real get_initval ();
523 static void Initialize ();
524 static void Finalize ();
525 static bool initialized;
526
527protected:
528
530
535 static FABio::Format format;
536 static FABio::Ordering ordering;
537
539 static FABio* fabio;
540
542 static bool do_initval;
543 static Real initval;
544 static bool init_snan;
545};
546
548
549template <RunOn run_on>
551FArrayBox::operator= (Real v) noexcept
552{
553 BaseFab<Real>::operator=<run_on>(v);
554 return *this;
555}
556
557template <RunOn run_on>
558bool
559FArrayBox::contains_nan () const noexcept
560{
561 const Real* dp = dptr;
562 const Long n = numPts()*nvar;
563#ifdef AMREX_USE_GPU
564 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
566 ReduceData<int> reduce_data(reduce_op);
567 using ReduceTuple = ReduceData<int>::Type;
568 reduce_op.eval(n, reduce_data,
569 [=] AMREX_GPU_DEVICE (Long i) -> ReduceTuple
570 {
571 return { static_cast<int>(amrex::isnan(dp[i])) };
572 });
573 ReduceTuple hv = reduce_data.value(reduce_op);
574 return amrex::get<0>(hv);
575 } else
576#endif
577 {
578 for (Long i = 0; i < n; i++) {
579 if (amrex::isnan(*dp++)) {
580 return true;
581 }
582 }
583 return false;
584 }
585}
586
587template <RunOn run_on>
588bool
589FArrayBox::contains_nan (const Box& bx, int scomp, int ncomp) const noexcept
590{
591 BL_ASSERT(scomp >= 0);
592 BL_ASSERT(ncomp >= 1);
593 BL_ASSERT(scomp < nComp());
594 BL_ASSERT(ncomp <= nComp());
596
597 const auto& a = this->array();
598
599#ifdef AMREX_USE_GPU
600 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
602 ReduceData<int> reduce_data(reduce_op);
603 using ReduceTuple = ReduceData<int>::Type;
604 reduce_op.eval(bx, reduce_data,
605 [=] AMREX_GPU_DEVICE (int i, int j, int k) -> ReduceTuple
606 {
607 bool t = false;
608 for (int n = scomp; n < scomp+ncomp; ++n) {
609 t = t || amrex::isnan(a(i,j,k,n));
610 }
611 return { static_cast<int>(t) };
612 });
613 ReduceTuple hv = reduce_data.value(reduce_op);
614 return amrex::get<0>(hv);
615 } else
616#endif
617 {
618 for (int n = scomp; n < scomp+ncomp; ++n) {
619 for (IntVect iv : bx.iterator()) {
620 if (amrex::isnan(a(iv, n))) {
621 return true;
622 }
623 }
624 }
625 return false;
626 }
627}
628
629template <RunOn run_on>
630bool
631FArrayBox::contains_nan (IntVect& where) const noexcept
632{
633 return contains_nan<run_on>(domain, 0, nComp(), where);
634}
635
636template <RunOn run_on>
637bool
638FArrayBox::contains_nan (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept
639{
640 BL_ASSERT(scomp >= 0);
641 BL_ASSERT(ncomp >= 1);
642 BL_ASSERT(scomp < nComp());
643 BL_ASSERT(ncomp <= nComp());
645
646 const auto& a = this->array();
647#ifdef AMREX_USE_GPU
648 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
649 Array<int,1+AMREX_SPACEDIM> ha{0,AMREX_D_DECL(std::numeric_limits<int>::lowest(),
650 std::numeric_limits<int>::lowest(),
651 std::numeric_limits<int>::lowest())};
652 Gpu::DeviceVector<int> dv(1+AMREX_SPACEDIM);
653 int* p = dv.data();
654 Gpu::htod_memcpy_async(p, ha.data(), sizeof(int)*ha.size());
655 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
656 {
657 int* flag = p;
658 bool t = false;
659 for (int n = scomp; n < scomp+ncomp; ++n) {
660 t = t || amrex::isnan(a(i,j,k,n));
661 }
662 if (t && (*flag == 0)) {
663 if (Gpu::Atomic::Exch(flag,1) == 0) {
664 AMREX_D_TERM(p[1] = i;,
665 p[2] = j;,
666 p[3] = k;);
667 }
668 }
669 });
670 Gpu::dtoh_memcpy_async(ha.data(), p, sizeof(int)*ha.size());
672 where = IntVect(AMREX_D_DECL(ha[1],ha[2],ha[3]));
673 return ha[0];
674 } else
675#endif
676 {
677 for (int n = scomp; n < scomp+ncomp; ++n) {
678 for (IntVect iv : bx.iterator()) {
679 if (amrex::isnan(a(iv, n))) {
680 where = iv;
681 return true;
682 }
683 }
684 }
685 return false;
686 }
687}
688
689template <RunOn run_on>
690bool
691FArrayBox::contains_inf () const noexcept
692{
693 const Real* dp = dptr;
694 const Long n = numPts()*nvar;
695#ifdef AMREX_USE_GPU
696 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
698 ReduceData<int> reduce_data(reduce_op);
699 using ReduceTuple = ReduceData<int>::Type;
700 reduce_op.eval(n, reduce_data,
701 [=] AMREX_GPU_DEVICE (Long i) -> ReduceTuple
702 {
703 return { static_cast<int>(amrex::isinf(dp[i])) };
704 });
705 ReduceTuple hv = reduce_data.value(reduce_op);
706 return amrex::get<0>(hv);
707 } else
708#endif
709 {
710 for (Long i = 0; i < n; i++) {
711 if (amrex::isinf(*dp++)) {
712 return true;
713 }
714 }
715 return false;
716 }
717}
718
719template <RunOn run_on>
720bool
721FArrayBox::contains_inf (const Box& bx, int scomp, int ncomp) const noexcept
722{
723 BL_ASSERT(scomp >= 0);
724 BL_ASSERT(ncomp >= 1);
725 BL_ASSERT(scomp < nComp());
726 BL_ASSERT(ncomp <= nComp());
728
729 const auto& a = this->array();
730
731#ifdef AMREX_USE_GPU
732 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
734 ReduceData<int> reduce_data(reduce_op);
735 using ReduceTuple = ReduceData<int>::Type;
736 reduce_op.eval(bx, reduce_data,
737 [=] AMREX_GPU_DEVICE (int i, int j, int k) ->ReduceTuple
738 {
739 bool t = false;
740 for (int n = scomp; n < scomp+ncomp; ++n) {
741 t = t || amrex::isinf(a(i,j,k,n));
742 }
743 return { static_cast<int>(t) };
744 });
745 ReduceTuple hv = reduce_data.value(reduce_op);
746 return amrex::get<0>(hv);
747 } else
748#endif
749 {
750 for (int n = scomp; n < scomp+ncomp; ++n) {
751 for (IntVect iv : bx.iterator()) {
752 if (amrex::isinf(a(iv, n))) {
753 return true;
754 }
755 }
756 }
757 return false;
758 }
759}
760
761template <RunOn run_on>
762bool
763FArrayBox::contains_inf (IntVect& where) const noexcept
764{
765 return contains_inf<run_on>(domain,0,nComp(),where);
766}
767
768template <RunOn run_on>
769bool
770FArrayBox::contains_inf (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept
771{
772 BL_ASSERT(scomp >= 0);
773 BL_ASSERT(ncomp >= 1);
774 BL_ASSERT(scomp < nComp());
775 BL_ASSERT(ncomp <= nComp());
777
778 const auto& a = this->array();
779#ifdef AMREX_USE_GPU
780 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
781 Array<int,1+AMREX_SPACEDIM> ha{0,AMREX_D_DECL(std::numeric_limits<int>::lowest(),
782 std::numeric_limits<int>::lowest(),
783 std::numeric_limits<int>::lowest())};
784 Gpu::DeviceVector<int> dv(1+AMREX_SPACEDIM);
785 int* p = dv.data();
786 Gpu::htod_memcpy_async(p, ha.data(), sizeof(int)*ha.size());
787 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
788 {
789 int* flag = p;
790 bool t = false;
791 for (int n = scomp; n < scomp+ncomp; ++n) {
792 t = t || amrex::isinf(a(i,j,k,n));
793 }
794 if (t && (*flag == 0)) {
795 if (Gpu::Atomic::Exch(flag,1) == 0) {
796 AMREX_D_TERM(p[1] = i;,
797 p[2] = j;,
798 p[3] = k;);
799 }
800 }
801 });
802 Gpu::dtoh_memcpy_async(ha.data(), p, sizeof(int)*ha.size());
804 where = IntVect(AMREX_D_DECL(ha[1],ha[2],ha[3]));
805 return ha[0];
806 } else
807#endif
808 {
809 for (int n = scomp; n < scomp+ncomp; ++n) {
810 for (IntVect iv : bx.iterator()) {
811 if (amrex::isinf(a(iv, n))) {
812 where = iv;
813 return true;
814 }
815 }
816 }
817 return false;
818 }
819}
820
821}
822
823#endif /*BL_FARRAYBOX_H*/
#define BL_ASSERT(EX)
Definition AMReX_BLassert.H:39
BaseFab container template providing box-based field storage.
#define AMREX_DEFAULT_RUNON
Definition AMReX_GpuControl.H:69
#define AMREX_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
Abstract base class for memory arenas.
Definition AMReX_Arena.H:153
A FortranArrayBox(FAB)-like object.
Definition AMReX_BaseFab.H:222
Array4< Real const > array() const noexcept
Create an Array4 view over all components.
Definition AMReX_BaseFab.H:475
Box domain
My index space.
Definition AMReX_BaseFab.H:1304
Real * dptr
The data pointer.
Definition AMReX_BaseFab.H:1303
int nvar
Number components.
Definition AMReX_BaseFab.H:1305
Long numPts() const noexcept
Returns the number of points.
Definition AMReX_BaseFab.H:351
int nComp() const noexcept
Returns the number of components.
Definition AMReX_BaseFab.H:343
__host__ __device__ bool contains(const IntVectND< dim > &p) const noexcept
Return true if argument is contained within BoxND.
Definition AMReX_Box.H:233
Definition AMReX_FabFactory.H:76
Definition AMReX_FArrayBox.H:169
void read(std::istream &is, FArrayBox &fb) const override
Pure virtual function. Derived classes MUST override this function to read an FArrayBox from the istr...
Definition AMReX_FArrayBox.cpp:918
void skip(std::istream &is, FArrayBox &f) const override
Pure virtual function. Derived classes MUST override this function to skip over the next FAB f in the...
Definition AMReX_FArrayBox.cpp:952
void write(std::ostream &os, const FArrayBox &fb, int comp, int num_comp) const override
Pure virtual function. Derived classes MUST override this function to write the FArrayBox to the ostr...
Definition AMReX_FArrayBox.cpp:932
A Class Facilitating I/O for Fabs.
Definition AMReX_FArrayBox.H:35
Format
An enum which controls format of FAB output.
Definition AMReX_FArrayBox.H:72
@ FAB_IEEE
Definition AMReX_FArrayBox.H:74
@ FAB_NATIVE_32
Definition AMReX_FArrayBox.H:82
@ FAB_ASCII
Definition AMReX_FArrayBox.H:73
@ FAB_NATIVE
Definition AMReX_FArrayBox.H:75
@ FAB_8BIT
Definition AMReX_FArrayBox.H:80
@ FAB_IEEE_32
Definition AMReX_FArrayBox.H:81
virtual void skip(std::istream &is, FArrayBox &f) const =0
Pure virtual function. Derived classes MUST override this function to skip over the next FAB f in the...
Precision
An enum which controls precision of FAB output. Valid values are FAB_FLOAT and FAB_DOUBLE....
Definition AMReX_FArrayBox.H:45
@ FAB_DOUBLE
Definition AMReX_FArrayBox.H:47
@ FAB_FLOAT
Definition AMReX_FArrayBox.H:46
virtual void read(std::istream &is, FArrayBox &fb) const =0
Pure virtual function. Derived classes MUST override this function to read an FArrayBox from the istr...
virtual void skip(std::istream &is, FArrayBox &f, int nCompToSkip) const =0
static FABio * read_header(std::istream &is, FArrayBox &f)
Read in the header from the istream. Returns a new'd FABio of the written-out type....
Definition AMReX_FArrayBox.cpp:448
virtual void write(std::ostream &os, const FArrayBox &fb, int comp, int num_comp) const =0
Pure virtual function. Derived classes MUST override this function to write the FArrayBox to the ostr...
Ordering
An enum which controls byte ordering of FAB output. Valid values are FAB_NORMAL_ORDER,...
Definition AMReX_FArrayBox.H:93
@ FAB_REVERSE_ORDER
Definition AMReX_FArrayBox.H:95
@ FAB_NORMAL_ORDER
Definition AMReX_FArrayBox.H:94
@ FAB_REVERSE_ORDER_2
Definition AMReX_FArrayBox.H:96
virtual ~FABio()=default
The virtual destructor.
virtual void write_header(std::ostream &os, const FArrayBox &f, int nvar) const
Write out a header describing FArrayBox f that contains nvar components. It must be the case that nva...
Definition AMReX_FArrayBox.cpp:95
A Fortran Array of REALs.
Definition AMReX_FArrayBox.H:237
void initVal() noexcept
Definition AMReX_FArrayBox.cpp:143
static void Finalize()
Definition AMReX_FArrayBox.cpp:431
static std::string getClassName()
Return the runtime class name (for metadata headers).
Definition AMReX_FArrayBox.cpp:222
static bool initialized
Definition AMReX_FArrayBox.H:525
static Box skipFAB(std::istream &is, int &num_comp)
Skip over the next FAB from the input stream. Return the Box defining the domain of the FAB and the n...
Definition AMReX_FArrayBox.cpp:673
static void Initialize()
Initialize from ParmParse with "fab" prefix.
Definition AMReX_FArrayBox.cpp:333
static FABio::Precision getPrecision()
Returns the FABio::Precision. This is deprecated. It is not useful with the "new" FAB I/O format....
Definition AMReX_FArrayBox.cpp:298
FabType getType() const noexcept
Return the embedded-boundary FabType of this FAB (always regular for a plain FArrayBox).
Definition AMReX_FArrayBox.H:402
static void setOrdering(FABio::Ordering ordering)
Set the FABio::Ordering for reading old FABs. It does NOT set the ordering for output....
Definition AMReX_FArrayBox.cpp:278
void writeOn(std::ostream &os) const
Write every component of the FAB using the current FABio format (the default format is NATIVE).
Definition AMReX_FArrayBox.cpp:228
FArrayBox(Array4< Real const > const &a) noexcept
Definition AMReX_FArrayBox.H:285
static Real initval
Definition AMReX_FArrayBox.H:543
static const FABio & getFABio()
Returns reference to the FABio object used by the program.
Definition AMReX_FArrayBox.cpp:191
static void setFormat(FABio::Format fmt)
Set the FABio::Format in the program. This is the preferred way to set the output format in "new" FAB...
Definition AMReX_FArrayBox.cpp:241
static void setPrecision(FABio::Precision precision)
Set the FABio::Precision. This is deprecated. It is not useful with the "new" FAB I/O format.
Definition AMReX_FArrayBox.cpp:292
static void setFABio(FABio *rd)
Replace the global FABio helper used by the program, taking ownership of rd. It is an error if rd is ...
Definition AMReX_FArrayBox.cpp:197
static FABio * fabio
The FABio pointer describing our output format.
Definition AMReX_FArrayBox.H:539
FabType m_type
Definition AMReX_FArrayBox.H:529
void readFrom(std::istream &is)
Read FAB from is using whichever FABio format it was written with.
Definition AMReX_FArrayBox.cpp:625
static FABio::Format format
Format and ordering for all FAB output. This stuff exists solely to support reading old FABs.
Definition AMReX_FArrayBox.H:535
FArrayBox(Array4< Real const > const &a, IndexType t) noexcept
Definition AMReX_FArrayBox.H:287
FArrayBox(Array4< Real > const &a, IndexType t) noexcept
Definition AMReX_FArrayBox.H:283
static FABio::Ordering ordering
Definition AMReX_FArrayBox.H:536
static std::unique_ptr< RealDescriptor > getDataDescriptor()
Return a copy of the RealDescriptor describing the on-disk layout.
Definition AMReX_FArrayBox.cpp:205
static FABio::Ordering getOrdering()
Gets the FABio::Ordering set in the program. This is deprecated. It does NOT do the right thing with ...
Definition AMReX_FArrayBox.cpp:285
static Real get_initval()
Query the current initialization value.
Definition AMReX_FArrayBox.cpp:327
static bool do_initval
initial value
Definition AMReX_FArrayBox.H:542
bool contains_nan() const noexcept
Test whether any NaN is present anywhere in the FAB.
Definition AMReX_FArrayBox.H:559
FArrayBox() noexcept=default
Construct an invalid FAB with no memory.
static FABio::Format getFormat()
Gets the FABio::Format set in the program.
Definition AMReX_FArrayBox.cpp:185
static Real set_initval(Real iv)
Set the default value used for initialization.
Definition AMReX_FArrayBox.cpp:319
static bool set_do_initval(bool tf)
Enable or disable initializing newly allocated elements to the init value.
Definition AMReX_FArrayBox.cpp:305
void resize(const Box &b, int N=1, Arena *ar=nullptr)
For debugging purposes we hide BaseFab version and do some extra work.
Definition AMReX_FArrayBox.cpp:178
static bool get_do_initval()
Query whether init-value filling is enabled.
Definition AMReX_FArrayBox.cpp:313
static bool init_snan
Definition AMReX_FArrayBox.H:544
~FArrayBox() noexcept override=default
The destructor.
bool contains_inf() const noexcept
Test whether any Inf is present anywhere in the FAB.
Definition AMReX_FArrayBox.H:691
GPU-compatible tuple.
Definition AMReX_Tuple.H:98
Dynamically allocated vector for trivially copyable data.
Definition AMReX_PODVector.H:308
T * data() noexcept
Definition AMReX_PODVector.H:666
A Descriptor of the Real Type.
Definition AMReX_FabConv.H:105
Definition AMReX_Reduce.H:438
Type value()
Definition AMReX_Reduce.H:473
Definition AMReX_Reduce.H:597
void eval(MF const &mf, IntVect const &nghost, D &reduce_data, F &&f)
Definition AMReX_Reduce.H:731
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
amrex_long Long
Definition AMReX_INT.H:30
std::array< T, N > Array
Definition AMReX_Array.H:31
__host__ __device__ AMREX_FORCE_INLINE T Exch(T *address, T val) noexcept
Definition AMReX_GpuAtomic.H:487
void streamSynchronize() noexcept
Definition AMReX_GpuDevice.H:310
void dtoh_memcpy_async(void *p_h, const void *p_d, const std::size_t sz) noexcept
Definition AMReX_GpuDevice.H:435
bool inLaunchRegion() noexcept
Definition AMReX_GpuControl.H:88
void htod_memcpy_async(void *p_d, const void *p_h, const std::size_t sz) noexcept
Definition AMReX_GpuDevice.H:421
Definition AMReX_Amr.cpp:50
MakeType
Definition AMReX_MakeType.H:7
RunOn
Definition AMReX_GpuControl.H:65
void ParallelFor(TypeList< CTOs... > ctos, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
Definition AMReX_CTOParallelForImpl.H:202
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
FabType
Definition AMReX_FabFactory.H:18
A multidimensional array accessor.
Definition AMReX_Array4.H:288
void * alloc(std::size_t sz) const noexcept
Allocate sz bytes from the arena.
Definition AMReX_DataAllocator.H:31