ElementObjectData.cc 1.32 KB
Newer Older
Thomas Witkowski's avatar
Thomas Witkowski committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "ElementObjectData.h"

namespace AMDiS {

  void ElementObjects::createRankData() 
  {
    for (std::map<DegreeOfFreedom, std::vector<ElementObjectData> >::iterator it = vertexElements.begin();
	 it != vertexElements.end(); ++it) {
      for (std::vector<ElementObjectData>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
	int elOwner = elementInRank[it2->elIndex];
	
	if (it2->elIndex > vertexInRank[it->first][elOwner].elIndex)
	  vertexInRank[it->first][elOwner] = *it2;
      }
    }
    
    
    for (std::map<DofEdge, std::vector<ElementObjectData> >::iterator it = edgeElements.begin();
	 it != edgeElements.end(); ++it) {
      for (std::vector<ElementObjectData>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
	int elOwner = elementInRank[it2->elIndex];
	
	if (it2->elIndex > edgeInRank[it->first][elOwner].elIndex)
	  edgeInRank[it->first][elOwner] = *it2;
      }
    }
    
    for (std::map<DofFace, std::vector<ElementObjectData> >::iterator it = faceElements.begin();
	 it != faceElements.end(); ++it) {
      for (std::vector<ElementObjectData>::iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
	int elOwner = elementInRank[it2->elIndex];
	
	if (it2->elIndex > faceInRank[it->first][elOwner].elIndex)
	  faceInRank[it->first][elOwner] = *it2;
      }
    }
  }

}