MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / loadMatrix

Method loadMatrix

Source/radiation/HypreMultiABec.cpp:2180–2529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178}
2179
2180void HypreMultiABec::loadMatrix()
2181{
2182 BL_PROFILE("HypreMultiABec::loadMatrix");
2183
2184#if (AMREX_SPACEDIM == 1)
2185 // if we were really 1D:
2186/*
2187 int offsets[3][1] = {{ 0}
2188 {-1},
2189 { 1}};
2190*/
2191 // fake 1D as a 2D problem:
2192 int offsets[3][2] = {{ 0, 0},
2193 {-1, 0},
2194 { 1, 0}};
2195#elif (AMREX_SPACEDIM == 2)
2196 int offsets[5][2] = {{ 0, 0},
2197 {-1, 0},
2198 { 1, 0},
2199 { 0, -1},
2200 { 0, 1}};
2201#elif (AMREX_SPACEDIM == 3)
2202 int offsets[7][3] = {{ 0, 0, 0},
2203 {-1, 0, 0},
2204 { 1, 0, 0},
2205 { 0, -1, 0},
2206 { 0, 1, 0},
2207 { 0, 0, -1},
2208 { 0, 0, 1}};
2209#endif
2210
2211 const int size = 2 * AMREX_SPACEDIM + 1;
2212 int i, idim;
2213
2214 int stencil_indices[size];
2215
2216 for (i = 0; i < size; i++) {
2217 stencil_indices[i] = i;
2218 }
2219
2220 BaseFab<GpuArray<Real, size>> matfab; // AoS indexing
2221 FArrayBox smatfab;
2222 for (int level = crse_level; level <= fine_level; level++) {
2223 int part = level - crse_level;
2224
2225 for (MFIter mfi(*acoefs[level]); mfi.isValid(); ++mfi) {
2226 i = mfi.index();
2227 const Box &reg = grids[level][i];
2228
2229 matfab.resize(reg);
2230 Real* mat = (Real*) matfab.dataPtr();
2231 Elixir mat_elix = matfab.elixir();
2232
2233 // build matrix interior
2234
2235 hmac(reg, matfab.array(), (*acoefs[level])[mfi].array(), alpha);
2236
2237 for (idim = 0; idim < AMREX_SPACEDIM; idim++) {

Callers 1

levelSolveMethod · 0.45

Calls 15

loVFunction · 0.85
hiVFunction · 0.85
isValidMethod · 0.80
sizeMethod · 0.80
firstLocalMethod · 0.80
nextLocalMethod · 0.80
pushMethod · 0.80
emptyMethod · 0.80
secondaryMethod · 0.80
collapseMethod · 0.80
get_locationsMethod · 0.80
get_coeffsMethod · 0.80

Tested by

no test coverage detected