ASL 0.1.7
Advanced Simulation Library
Loading...
Searching...
No Matches
aslWriter.h
Go to the documentation of this file.
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
32namespace acl
33{
34 class VectorOfElements;
35 class VectorOfElementsData;
36 class Kernel;
37}
38
39namespace asl
40{
41 class AbstractData;
42 class Block;
43
44 class Writer
45 {
46 public:
47 Writer(const std::string & file_);
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
OpenCl Kernel generator.
Definition: aclKernel.h:49
The class represents several ElementData.
The class represents several Element.
virtual void write()=0
Writer(const std::string &file_)
void addVector(std::string name, acl::VectorOfElementsData &data)
void addScalars(std::string name, const acl::VectorOfElements &data, acl::Kernel &kernel, unsigned int nGhost=1)
static Writer * current
Definition: aslWriter.h:64
unsigned int numOfWrites
Definition: aslWriter.h:71
std::shared_ptr< Block > block
Definition: aslWriter.h:67
void addVector(std::string name, AbstractData &data)
void enable()
void addVector(std::string name, const acl::VectorOfElements &data, acl::Kernel &kernel, unsigned int nGhost=1)
std::vector< std::pair< std::string, acl::VectorOfElementsData > > vectorFields
Definition: aslWriter.h:69
std::string file
Definition: aslWriter.h:70
std::vector< std::pair< std::string, acl::VectorOfElementsData > > scalarFields
Definition: aslWriter.h:68
void addScalars(std::string name, AbstractData &data)
void addScalars(std::string name, acl::VectorOfElementsData &data)
Advanced Computational Language.
Definition: acl.h:41
Advanced Simulation Library.
Definition: aslDataInc.h:31