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

Method add

Src/Base/AMReX_BoxDomain.cpp:120–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118{}
119
120void
121BoxDomain::add (const Box& b)
122{
123 BL_ASSERT(b.ixType() == ixType());
124
125 Vector<Box> tmp, check;
126
127 check.push_back(b);
128
129 for (const auto& bx : *this)
130 {
131 tmp.clear();
132 for (auto& cbx : check)
133 {
134 if (cbx.intersects(bx))
135 {
136 const BoxList& tmpbl = amrex::boxDiff(cbx, bx);
137 tmp.insert(std::end(tmp), std::begin(tmpbl), std::end(tmpbl));
138 cbx = Box();
139 }
140 }
141 std::erase_if(check, [](const Box& x) { return x.isEmpty(); });
142 check.insert(std::end(check), std::begin(tmp), std::end(tmp));
143 }
144 join(check);
145 BL_ASSERT(ok());
146}
147
148void
149BoxDomain::add (const BoxList& bl)

Callers 9

InitializeMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
InitializeMethod · 0.45
amrex_parmparse_add_intFunction · 0.45
amrex_parmparse_add_realFunction · 0.45
amrex_parmparse_add_boolFunction · 0.45
AddBoxMethod · 0.45

Calls 10

boxDiffFunction · 0.85
joinFunction · 0.85
removeOverlapFunction · 0.85
catenateMethod · 0.80
ixTypeMethod · 0.45
push_backMethod · 0.45
clearMethod · 0.45
intersectsMethod · 0.45
insertMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected