Line data Source code
1 : /*
2 : * Copyright (c) 2009-2015: G-CSC, Goethe University Frankfurt
3 : * Author: Sebastian Reiter
4 : *
5 : * This file is part of UG4.
6 : *
7 : * UG4 is free software: you can redistribute it and/or modify it under the
8 : * terms of the GNU Lesser General Public License version 3 (as published by the
9 : * Free Software Foundation) with the following additional attribution
10 : * requirements (according to LGPL/GPL v3 §7):
11 : *
12 : * (1) The following notice must be displayed in the Appropriate Legal Notices
13 : * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14 : *
15 : * (2) The following notice must be displayed at a prominent place in the
16 : * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17 : *
18 : * (3) The following bibliography is recommended for citation and must be
19 : * preserved in all covered files:
20 : * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21 : * parallel geometric multigrid solver on hierarchically distributed grids.
22 : * Computing and visualization in science 16, 4 (2013), 151-164"
23 : * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24 : * flexible software system for simulating pde based models on high performance
25 : * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26 : *
27 : * This program is distributed in the hope that it will be useful,
28 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
29 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 : * GNU Lesser General Public License for more details.
31 : */
32 :
33 : #include "grid_object_collection.h"
34 :
35 : namespace ug
36 : {
37 : ////////////////////////////////////////////////////////////////////////
38 : ////////////////////////////////////////////////////////////////////////
39 : // GridObjectCollection
40 0 : GridObjectCollection::
41 : GridObjectCollection(size_t levelEstimate)
42 : {
43 0 : m_levels.reserve(levelEstimate);
44 0 : }
45 :
46 0 : GridObjectCollection::
47 : GridObjectCollection(ElementStorage<Vertex>::SectionContainer* vrtCon,
48 : ElementStorage<Edge>::SectionContainer* edgeCon,
49 : ElementStorage<Face>::SectionContainer* faceCon,
50 : ElementStorage<Volume>::SectionContainer* volCon)
51 : {
52 0 : m_levels.reserve(1);
53 0 : add_level(vrtCon, edgeCon, faceCon, volCon);
54 0 : }
55 :
56 0 : GridObjectCollection::
57 : GridObjectCollection(const GridObjectCollection& mgoc)
58 : {
59 0 : assign(mgoc);
60 0 : }
61 :
62 : GridObjectCollection&
63 0 : GridObjectCollection::
64 : operator =(const GridObjectCollection& mgoc)
65 : {
66 0 : assign(mgoc);
67 0 : return *this;
68 : }
69 :
70 : void
71 0 : GridObjectCollection::
72 : assign(const GridObjectCollection& mgoc)
73 : {
74 0 : m_levels.resize(mgoc.num_levels());
75 0 : for(size_t i = 0; i < m_levels.size(); ++i)
76 0 : m_levels[i] = mgoc.m_levels[i];
77 0 : }
78 :
79 : void
80 0 : GridObjectCollection::
81 : add_level(ElementStorage<Vertex>::SectionContainer* vrtCon,
82 : ElementStorage<Edge>::SectionContainer* edgeCon,
83 : ElementStorage<Face>::SectionContainer* faceCon,
84 : ElementStorage<Volume>::SectionContainer* volCon)
85 : {
86 0 : m_levels.push_back(ContainerCollection( vrtCon,
87 : edgeCon,
88 : faceCon,
89 : volCon));
90 0 : }
91 :
92 :
93 0 : GridObjectCollection::ContainerCollection::
94 : ContainerCollection(ElementStorage<Vertex>::SectionContainer* vrtCon,
95 : ElementStorage<Edge>::SectionContainer* edgeCon,
96 : ElementStorage<Face>::SectionContainer* faceCon,
97 0 : ElementStorage<Volume>::SectionContainer* volCon)
98 : {
99 0 : vrtContainer = vrtCon;
100 0 : edgeContainer = edgeCon;
101 0 : faceContainer = faceCon;
102 0 : volContainer = volCon;
103 0 : }
104 :
105 : }// end of namespace
|