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

Method buildMatrixStructure

Source/radiation/HypreMultiABec.cpp:964–1304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

962}
963
964void HypreMultiABec::buildMatrixStructure()
965{
966 // Build MultiFabs first, so that distribution maps are available
967 // when building the graph below:
968
969 for (int level = crse_level; level <= fine_level; level++) {
970 int ncomp=1;
971 int ngrow=0;
972 acoefs[level].reset(new MultiFab(grids[level], dmap[level], ncomp, ngrow));
973 acoefs[level]->setVal(0.0);
974
975 bcoefs[level].reset(new Array<MultiFab, AMREX_SPACEDIM>);
976
977 for (int i = 0; i < AMREX_SPACEDIM; i++) {
978 BoxArray edge_boxes(grids[level]);
979 edge_boxes.surroundingNodes(i);
980 (*bcoefs[level])[i].define(edge_boxes, dmap[level], ncomp, ngrow);
981 (*bcoefs[level])[i].setVal(0.0);
982 }
983 }
984
985 // This can be done now that addLevel has been called for each level:
986
987 HYPRE_SStructGridAssemble(hgrid);
988
989 // Setup stencils:
990
991#if (AMREX_SPACEDIM == 1)
992 // if we were really 1D:
993/*
994 int offsets[3][1] = {{ 0}
995 {-1},
996 { 1}};
997*/
998 // fake 1D as a 2D problem:
999 int offsets[3][2] = {{ 0, 0},
1000 {-1, 0},
1001 { 1, 0}};
1002#elif (AMREX_SPACEDIM == 2)
1003 int offsets[5][2] = {{ 0, 0},
1004 {-1, 0},
1005 { 1, 0},
1006 { 0, -1},
1007 { 0, 1}};
1008#elif (AMREX_SPACEDIM == 3)
1009 int offsets[7][3] = {{ 0, 0, 0},
1010 {-1, 0, 0},
1011 { 1, 0, 0},
1012 { 0, -1, 0},
1013 { 0, 1, 0},
1014 { 0, 0, -1},
1015 { 0, 0, 1}};
1016#endif
1017
1018 BL_ASSERT(stencil == NULL);
1019#if (AMREX_SPACEDIM == 1)
1020 HYPRE_SStructStencilCreate(2, 3, &stencil);
1021#else

Callers 1

RadSolveMethod · 0.80

Calls 12

TransverseInterpolantFunction · 0.85
NormalDerivativeFunction · 0.85
defineMethod · 0.80
firstLocalMethod · 0.80
isValidMethod · 0.80
nextLocalMethod · 0.80
pushMethod · 0.80
secondaryMethod · 0.80
emptyMethod · 0.80
collapseMethod · 0.80
get_locationsMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected