ElementRegion_ED.h 1.97 KB
Newer Older
1
2
3
4
// ============================================================================
// ==                                                                        ==
// == AMDiS - Adaptive multidimensional simulations                          ==
// ==                                                                        ==
5
// ==  http://www.amdis-fem.org                                              ==
6
7
// ==                                                                        ==
// ============================================================================
8
9
10
11
12
13
14
15
16
17
18
19
//
// Software License for AMDiS
//
// Copyright (c) 2010 Dresden University of Technology 
// All rights reserved.
// Authors: Simon Vey, Thomas Witkowski et al.
//
// This file is part of AMDiS
//
// See also license.opensource.txt in the distribution.


20

21
/** \file ElementRegionED.h */
22

23
24
#ifndef AMDIS_ELEMENTREGIONED_H
#define AMDIS_ELEMENTREGIONED_H
25
26
27
28
29
30
31
32
33

#include "ElementData.h"
#include "FixVec.h"

namespace AMDiS {

  class ElementRegion_ED : public ElementData
  {
  public:
34
35
36
    inline bool isOfType(int typeID) const 
    {
      if (typeID == ELEMENT_REGION) 
37
38
	return true;
      return false;
39
    }
40
41
42
43

    class Creator : public CreatorInterface<ElementData>
    {
    public:
Thomas Witkowski's avatar
Thomas Witkowski committed
44
45
      ElementData* create() 
      {
Thomas Witkowski's avatar
Thomas Witkowski committed
46
	return new ElementRegion_ED;
47
      }
48
49
50
51
    };

    ElementRegion_ED(ElementData *decorated = NULL)
      : ElementData(decorated),
52
	region(-1)
53
    {}
54
55
56
57

    bool refineElementData(Element* parent, 
			   Element* child1,
			   Element* child2,
58
			   int elType);
59

60
    ElementData *clone() const;
61

Thomas Witkowski's avatar
Thomas Witkowski committed
62
63
    inline std::string getTypeName() const 
    { 
64
      return "ElementRegion_ED"; 
Thomas Witkowski's avatar
Thomas Witkowski committed
65
    }
66

Thomas Witkowski's avatar
Thomas Witkowski committed
67
68
69
70
    inline const int getTypeID() const 
    { 
      return ELEMENT_REGION; 
    }
71

72
    void serialize(std::ostream& out);
73

74
    void deserialize(std::istream& in); 
75

76
    inline void setRegion(int r) 
Thomas Witkowski's avatar
Thomas Witkowski committed
77
    { 
78
      region = r; 
Thomas Witkowski's avatar
Thomas Witkowski committed
79
    }
80

Thomas Witkowski's avatar
Thomas Witkowski committed
81
82
    inline int getRegion() const 
    { 
83
      return region; 
Thomas Witkowski's avatar
Thomas Witkowski committed
84
    }
85
86

  protected:
87
    int region;
88
89
90
91
92
  };

}

#endif