39 #include <boost/config.hpp>
40 #include <boost/graph/adjacency_list.hpp>
41 #include <boost/graph/cuthill_mckee_ordering.hpp>
42 #include <boost/graph/properties.hpp>
43 #include <boost/graph/bandwidth.hpp>
47 namespace MultiRegions
67 const std::string variable):
78 const int numLocalCoeffs,
80 const Array<OneD, const ExpListSharedPtr>
82 const Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
85 const std::string variable):
104 const int numLocalCoeffs,
140 const int numLocalCoeffs,
142 const Array<OneD, const MultiRegions::ExpListSharedPtr>
144 const Array<OneD, const SpatialDomains::BoundaryConditionShPtr>
159 int nbnd = bndCondExp.num_elements();
172 m_numLocalBndCoeffsPerPatch[i] = (
unsigned int) locExpVector[locExp.
GetOffset_Elmt_Id(i)]->NumBndryCoeffs();
173 m_numLocalIntCoeffsPerPatch[i] = (
unsigned int) locExpVector[locExp.
GetOffset_Elmt_Id(i)]->GetNcoeffs() - locExpVector[locExp.
GetOffset_Elmt_Id(i)]->NumBndryCoeffs();
198 map<int, int> vertReorderedGraphVertId;
200 PeriodicMap::const_iterator pIt;
204 for(i = 0; i < nbnd; i++)
206 ASSERTL0(bndCondExp[i]->GetNumElmts() > 0,
207 "Boundary expansion contains no expansions.");
210 meshVertId = bndCondExp[i]->GetExp(0)->GetGeom()->GetVertex(0)->GetVid();
211 vertReorderedGraphVertId[meshVertId] = graphVertId++;
219 for(pIt = periodicVerts.begin(); pIt != periodicVerts.end(); pIt++)
221 meshVertId = pIt->first;
222 meshVertId2 = pIt->second[0].id;
224 if (!pIt->second[0].isLocal)
226 if (vertReorderedGraphVertId.count(meshVertId) == 0)
228 vertReorderedGraphVertId[meshVertId] = graphVertId++;
233 if (vertReorderedGraphVertId.count(meshVertId) == 0 &&
234 vertReorderedGraphVertId.count(meshVertId2) == 0)
236 vertReorderedGraphVertId[meshVertId] = graphVertId;
237 vertReorderedGraphVertId[meshVertId2] = graphVertId++;
239 else if ((vertReorderedGraphVertId.count(meshVertId) == 0 &&
240 vertReorderedGraphVertId.count(meshVertId2) != 0) ||
241 (vertReorderedGraphVertId.count(meshVertId) != 0 &&
242 vertReorderedGraphVertId.count(meshVertId2) == 0))
245 "Numbering error for periodic boundary conditions!");
252 for(i = 0; i < locExpVector.size(); ++i)
255 if((locSegExp = locExpVector[i]->as<LocalRegions::SegExp>()))
257 for(j = 0; j < locSegExp->GetNverts(); ++j)
259 meshVertId = (locSegExp->GetGeom1D())->GetVid(j);
260 if(vertReorderedGraphVertId.count(meshVertId) == 0)
262 vertReorderedGraphVertId[meshVertId] = graphVertId++;
266 vertReorderedGraphVertId[meshVertId];
271 ASSERTL0(
false,
"dynamic cast to a segment expansion failed");
276 for(i = 0; i < nbnd; i++)
278 meshVertId = bndCondExp[i]->GetExp(0)->GetGeom()->GetVertex(0)->GetVid();
279 m_bndCondCoeffsToGlobalCoeffsMap[i] = vertReorderedGraphVertId[meshVertId];
283 globalId = graphVertId;