MCPcopy Create free account
hub / github.com/AMReX-Codes/amrex / define

Method define

Src/Base/AMReX_BoxArray.cpp:101–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101void
102BARef::define (std::istream& is, int& ndims)
103{
104 //
105 // TODO -- completely remove the fiction of a hash value.
106 //
107 BL_ASSERT(m_abox.empty());
108 int maxbox;
109 ULong tmphash;
110 is.ignore(bl_ignore_max, '(') >> maxbox >> tmphash;
111 AMREX_ASSERT(maxbox >= 0 && maxbox < std::numeric_limits<int>::max());
112 resize(maxbox);
113 auto pos = is.tellg();
114 {
115 ndims = AMREX_SPACEDIM;
116 char c1, c2;
117 int itmp;
118 is >> std::ws >> c1 >> std::ws >> c2;
119 if (c1 == '(' && c2 == '(') {
120 is >> itmp;
121 ndims = 1;
122#if (AMREX_SPACEDIM >= 2)
123 is >> std::ws;
124 int ic = is.peek();
125 if (ic == static_cast<int>(',')) {
126 is.ignore(BL_IGNORE_MAX, ',');
127 is >> itmp;
128 ++ndims;
129#if (AMREX_SPACEDIM == 3)
130 is >> std::ws;
131 ic = is.peek();
132 if (ic == static_cast<int>(',')) {
133 ++ndims;
134 }
135#endif
136 }
137#endif
138 }
139 }
140 is.seekg(pos, std::ios_base::beg);
141 for (auto& b : m_abox) {
142 is >> b;
143 }
144 is.ignore(bl_ignore_max, ')');
145 if (is.fail()) {
146 amrex::Error("BoxArray::define(istream&) failed");
147 }
148}
149
150void
151BARef::define (const Box& bx)

Callers 2

BoxArrayMethod · 0.45
readFromMethod · 0.45

Calls 5

BATransformerClass · 0.85
emptyMethod · 0.45
push_backMethod · 0.45
dataMethod · 0.45
ixTypeMethod · 0.45

Tested by

no test coverage detected