Debian Codegraph @

src/writers/aslWriter.h

raw
1 /*
2 * Advanced Simulation Library <http://asl.org.il>
3 *
4 * Copyright 2015 Avtech Scientific <http://avtechscientific.com>
5 *
6 *
7 * This file is part of Advanced Simulation Library (ASL).
8 *
9 * ASL is free software: you can redistribute it and/or modify it
10 * under the terms of the GNU Affero General Public License as
11 * published by the Free Software Foundation, version 3 of the License.
12 *
13 * ASL is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with ASL. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23
24 #ifndef ASLWRITER_H
25 #define ASLWRITER_H
26
27 //#include <acl/aclMath/aclVectorOfElementsDef.h>
28 #include<string>
29 #include<memory>
30 #include<vector>
31
32 namespace acl
33 {
34 class VectorOfElements;
35 class VectorOfElementsData;
36 class Kernel;
37 }
38
39 namespace asl
40 {
41 class AbstractData;
42 class Block;
43
44 class Writer
45 {
46 public:
47 Writer(const std::string & file_);
48 ~Writer();
49 virtual void write() = 0;
50 void enable();
51 void addScalars(std::string name, AbstractData & data);
52 void addVector(std::string name, AbstractData & data);
53 void addScalars(std::string name, acl::VectorOfElementsData & data);
54 void addVector(std::string name, acl::VectorOfElementsData & data);
55 void addScalars(std::string name,
56 const acl::VectorOfElements & data,
57 acl::Kernel & kernel,
58 unsigned int nGhost = 1);
59 void addVector(std::string name,
60 const acl::VectorOfElements & data,
61 acl::Kernel & kernel,
62 unsigned int nGhost = 1);
63
64 static Writer * current;
65
66 protected:
67 std::shared_ptr<Block> block;
68 std::vector<std::pair<std::string, acl::VectorOfElementsData>> scalarFields;
69 std::vector<std::pair<std::string, acl::VectorOfElementsData>> vectorFields;
70 std::string file;
71 unsigned int numOfWrites;
72 };
73
74 } // asl
75
76 #endif // ASLWRITER_H