Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "SundanceSpatiallyHomogeneousDOFMapBase.hpp"
00043 #include "PlayaTabs.hpp"
00044 #include "SundanceOut.hpp"
00045 #include "SundanceMaximalCellFilter.hpp"
00046
00047 using namespace Sundance;
00048 using namespace Teuchos;
00049
00050
00051 SpatiallyHomogeneousDOFMapBase
00052 ::SpatiallyHomogeneousDOFMapBase(const Mesh& mesh,
00053 int nTotalFuncs,
00054 int setupVerb)
00055 : DOFMapBase(mesh, setupVerb), allowedFuncs_(), funcDomains_()
00056 {
00057 RCP<Set<int> > f = rcp(new Set<int>());
00058 for (int i=0; i<nTotalFuncs; i++) f->put(i);
00059 allowedFuncs_ = f;
00060 CellFilter cf = new MaximalCellFilter();
00061 funcDomains_ = Array<CellFilter>(nTotalFuncs, cf);
00062 }
00063
00064
00065 void SpatiallyHomogeneousDOFMapBase::print(std::ostream& os) const
00066 {
00067 int myRank = mesh().comm().getRank();
00068
00069 Tabs tabs;
00070 int dim = mesh().spatialDim();
00071 RCP<const MapStructure> s = mapStruct();
00072
00073 for (int p=0; p<mesh().comm().getNProc(); p++)
00074 {
00075 mesh().comm().synchronize();
00076 mesh().comm().synchronize();
00077 if (p == myRank)
00078 {
00079 os << tabs <<
00080 "========= DOFMap on proc p=" << p << " =============" << std::endl;
00081 for (int d=dim; d>=0; d--)
00082 {
00083 Tabs tabs1;
00084 os << tabs1 << "dimension = " << d << std::endl;
00085 for (int c=0; c<mesh().numCells(d); c++)
00086 {
00087 Tabs tabs2;
00088 os << tabs2 << "Cell d=" << d << " LID=" << c << " GID="
00089 << mesh().mapLIDToGID(d, c);
00090 if (d==0)
00091 {
00092 os << " x=" << mesh().nodePosition(c) << std::endl;
00093 }
00094 else
00095 {
00096 Array<int> facetLIDs;
00097 Array<int> facetDirs;
00098 mesh().getFacetArray(d, c, 0, facetLIDs, facetDirs);
00099 Array<int> facetGIDs(facetLIDs.size());
00100 for (int v=0; v<facetLIDs.size(); v++)
00101 {
00102 facetGIDs[v] = mesh().mapLIDToGID(0, facetLIDs[v]);
00103 }
00104 os << " nodes LIDs=" << facetLIDs << " GIDs=" << facetGIDs
00105 << std::endl;
00106 }
00107 for (int b=0; b<s->numBasisChunks(); b++)
00108 {
00109 for (int f=0; f<s->funcs(b).size(); f++)
00110 {
00111 Tabs tabs3;
00112 Array<int> dofs;
00113 getDOFsForCell(d, c, s->funcs(b)[f], dofs);
00114 os << tabs3 << "f=" << s->funcs(b)[f] << " "
00115 << dofs << std::endl;
00116 if (false)
00117 {
00118 os << tabs3 << "{";
00119 for (int i=0; i<dofs.size(); i++)
00120 {
00121 if (i != 0) os << ", ";
00122 if (isLocalDOF(dofs[i])) os << "L";
00123 else os << "R";
00124 }
00125 os << "}" << std::endl;
00126 }
00127 }
00128 }
00129 }
00130 }
00131 }
00132 mesh().comm().synchronize();
00133 mesh().comm().synchronize();
00134 }
00135 }