ASL
0.1.7
Advanced Simulation Library
Toggle main menu visibility
Loading...
Searching...
No Matches
src
data
aslDataWrapper.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 ASLDATAWRAPPER_H
25
#define ASLDATAWRAPPER_H
26
27
#include "
aslBlocks.h
"
28
#include "
../acl/aclMath/aclVectorOfElementsDef.h
"
29
#include <iostream>
30
#include <fstream>
31
36
37
namespace
acl
38
{
39
void
copy
(
const
vector<Element> & source,
40
VectorOfElements
& destination);
41
void
copy
(
const
VectorOfElementsData
& source,
42
VectorOfElementsData
& destination);
43
}
44
45
46
using namespace
std
;
47
48
namespace
asl
49
{
50
52
class
AbstractData
53
{
54
protected
:
55
Block
block
;
56
inline
AbstractData
();
57
inline
explicit
AbstractData
(
const
Block
& b);
58
public
:
59
virtual
const
acl::VectorOfElements
getEContainer
() = 0;
60
virtual
const
acl::VectorOfElementsData
getDContainer
()
const
= 0;
61
inline
const
Block
&
getBlock
()
const
;
62
inline
void
setBlock
(
const
Block
& b);
63
};
64
65
typedef
shared_ptr<AbstractData>
SPAbstractData
;
66
67
69
76
template
<
typename
V>
class
DataWrapper
:
public
AbstractData
77
{
78
protected
:
79
V
container
;
80
virtual
bool
checkConsistency
()
const
;
81
public
:
82
inline
DataWrapper
();
83
inline
explicit
DataWrapper
(
const
Block
& b);
84
inline
DataWrapper
(
DataWrapper
& d);
85
virtual
const
acl::VectorOfElements
getEContainer
();
86
virtual
const
acl::VectorOfElementsData
getDContainer
()
const
;
87
inline
V &
getContainer
();
88
inline
void
setContainer
(
const
V & cont);
89
};
90
91
typedef
DataWrapper<acl::VectorOfElements>
DataWrapperACL
;
92
typedef
DataWrapper<acl::VectorOfElementsData>
DataWrapperACLData
;
93
94
typedef
shared_ptr<DataWrapperACL>
SPDataWrapperACL
;
95
typedef
shared_ptr<DataWrapperACLData>
SPDataWrapperACLData
;
96
97
98
// ---------------------------- Implementation ---------------------------
99
100
AbstractData::AbstractData
()
101
{
102
}
103
104
AbstractData::AbstractData
(
const
Block
& b):
105
block
(b)
106
{
107
}
108
109
template
<
typename
V>
DataWrapper<V>::DataWrapper
():
110
AbstractData
()
111
{
112
}
113
114
template
<
typename
V>
DataWrapper<V>::DataWrapper
(
const
Block
& b):
115
AbstractData
(b)
116
{
117
}
118
119
template
<
typename
V>
DataWrapper<V>::DataWrapper
(
DataWrapper
& d):
120
AbstractData
(d.
block
),
121
container
(d.
container
)
122
{
123
}
124
125
template
<
typename
V>
inline
V &
DataWrapper<V>::getContainer
()
126
{
127
return
container
;
128
}
129
130
template
<
typename
V>
inline
void
DataWrapper<V>::setContainer
(
const
V & cont)
131
{
132
copy(cont,
container
);
133
}
134
135
inline
const
Block
&
AbstractData::getBlock
()
const
136
{
137
return
block
;
138
}
139
140
inline
void
AbstractData::setBlock
(
const
Block
& b)
141
{
142
block
=b;
143
}
144
145
}
146
#endif
147
aclVectorOfElementsDef.h
aslBlocks.h
acl::VectorOfElementsData
The class represents several ElementData.
Definition
aclVectorOfElementsDef.h:57
acl::VectorOfElementsData::VectorOfElementsData
VectorOfElementsData()
acl::VectorOfElements
The class represents several Element.
Definition
aclVectorOfElementsDef.h:92
acl::VectorOfElements::VectorOfElements
VectorOfElements()
asl::AbstractData::AbstractData
AbstractData()
Definition
aslDataWrapper.h:100
asl::AbstractData::setBlock
void setBlock(const Block &b)
Definition
aslDataWrapper.h:140
asl::AbstractData::getDContainer
virtual const acl::VectorOfElementsData getDContainer() const =0
asl::AbstractData::getBlock
const Block & getBlock() const
Definition
aslDataWrapper.h:135
asl::AbstractData::block
Block block
Definition
aslDataWrapper.h:55
asl::AbstractData::getEContainer
virtual const acl::VectorOfElements getEContainer()=0
asl::Block
Definition
aslBlocks.h:57
asl::DataWrapper
Class defines a folding rule into a 1D/2D/3D bulk.
Definition
aslDataWrapper.h:77
asl::DataWrapper::DataWrapper
DataWrapper(DataWrapper &d)
Definition
aslDataWrapper.h:119
asl::DataWrapper::checkConsistency
virtual bool checkConsistency() const
asl::DataWrapper< acl::VectorOfElementsData >::container
acl::VectorOfElementsData container
Definition
aslDataWrapper.h:79
asl::DataWrapper::getEContainer
virtual const acl::VectorOfElements getEContainer()
asl::DataWrapper::DataWrapper
DataWrapper(const Block &b)
Definition
aslDataWrapper.h:114
asl::DataWrapper::DataWrapper
DataWrapper()
Definition
aslDataWrapper.h:109
asl::DataWrapper::getDContainer
virtual const acl::VectorOfElementsData getDContainer() const
asl::DataWrapper::getContainer
V & getContainer()
Definition
aslDataWrapper.h:125
asl::DataWrapper::setContainer
void setContainer(const V &cont)
Definition
aslDataWrapper.h:130
acl
Advanced Computational Language.
Definition
acl.h:41
acl::copy
void copy(MemBlock &source, T *destination)
asl
Advanced Simulation Library.
Definition
aslDataInc.h:31
asl::SPDataWrapperACLData
std::shared_ptr< DataWrapperACLData > SPDataWrapperACLData
Definition
aslGenerators.h:54
asl::SPAbstractData
shared_ptr< AbstractData > SPAbstractData
Definition
aslDataWrapper.h:65
asl::SPDataWrapperACL
std::shared_ptr< DataWrapperACL > SPDataWrapperACL
Definition
aslGenerators.h:56
asl::DataWrapperACLData
DataWrapper< acl::VectorOfElementsData > DataWrapperACLData
Definition
aslGenerators.h:53
asl::DataWrapperACL
DataWrapper< acl::VectorOfElements > DataWrapperACL
Definition
aslGenerators.h:55
std
STL namespace.
Generated by
1.17.0