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 #include "SundanceMap.hpp"
00032 #include "PlayaTabs.hpp"
00033 #include "SundanceOut.hpp"
00034 #include "SundanceOrderedTuple.hpp"
00035 #include "SundanceDOFMapBase.hpp"
00036 #include "PlayaMPIContainerComm.hpp"
00037 #include "Teuchos_TimeMonitor.hpp"
00038
00039 using namespace Sundance;
00040 using namespace Teuchos;
00041 using Playa::MPIComm;
00042 using Playa::MPIContainerComm;
00043
00044
00045
00046
00047 DOFMapBase::DOFMapBase(const Mesh& mesh, int setupVerb)
00048 : setupVerb_(setupVerb),
00049 localProcID_(mesh.comm().getRank()),
00050 mesh_(mesh),
00051 lowestLocalDOF_(),
00052 numLocalDOFs_(),
00053 numDOFs_(),
00054 ghostIndices_(rcp(new Array<int>()))
00055 {}
00056
00057
00058 void DOFMapBase::getDOFsForCell(int cellDim, int cellLID,
00059 int funcID,
00060 Array<int>& dofs) const
00061 {
00062 TimeMonitor timer(dofLookupTimer());
00063
00064 Array<Array<int> > allDofs;
00065 Array<int> nNodes;
00066 RCP<const MapStructure> s
00067 = getDOFsForCellBatch(cellDim, tuple(cellLID), makeSet(funcID), allDofs, nNodes,0);
00068
00069
00070 int chunkNumber = s->chunkForFuncID(funcID);
00071 int funcIndex = s->indexForFuncID(funcID);
00072 dofs.resize(nNodes[chunkNumber]);
00073 for (int i=0; i<nNodes[chunkNumber]; i++)
00074 {
00075 dofs[i] = allDofs[chunkNumber][nNodes[chunkNumber]*funcIndex + i];
00076 }
00077 }
00078
00079 Time& DOFMapBase::dofLookupTimer()
00080 {
00081 static RCP<Time> rtn
00082 = TimeMonitor::getNewTimer("unbatched dof lookup");
00083 return *rtn;
00084 }
00085
00086 Time& DOFMapBase::batchedDofLookupTimer()
00087 {
00088 static RCP<Time> rtn
00089 = TimeMonitor::getNewTimer("batched dof lookup");
00090 return *rtn;
00091 }
00092