Class documentation of Concepts

Loading...
Searching...
No Matches
matlabBinaryGraphics.hh
Go to the documentation of this file.
1
7#ifndef matlab_binary_hh
8#define matlab_binary_hh
9
10#include "matfile/matfileIO.hh"
11
16#include "matfile/matfileIO.hh"
17
18namespace graphics {
19
20 // ************************************************** MatlabBinaryGraphics **
21
28 public DenseMatrixGraphics {
29 public:
30
35 MatlabBinaryGraphics(const std::string filename);
36
41 template<class G>
43 const std::string filename);
44
51 const uint points = 5);
52
59 template<class G, class F>
61 const std::string filename,
62 const concepts::Vector<F>& sol,
63 const concepts::ElementFunction<F, G>* fun = 0);
64
72 template<class G, class F>
74 const std::string filename,
75 const concepts::Vector<F>& sol,
76 const std::string varName,
77 const concepts::ElementFunction<F, G>* fun = 0);
78
85 template<class G, class F>
87 const std::string filename,
88 std::vector<concepts::Vector<F> >& sol,
89 const concepts::ElementFunction<F, G>* fun = 0);
90
96 template<class G, class F>
98 const std::string filename,
100
101 virtual ~MatlabBinaryGraphics();
102
109 template<class F, class G>
110 void addSolution(const concepts::Space<G>& spc, const std::string name,
111 const concepts::Vector<F>& sol,
112 const concepts::ElementFunction<F, G>* fun = 0);
113
119 template<class F, class G>
120 void addFunction(const concepts::Space<G>& spc, const std::string name,
122 protected:
126 template<class G>
127 void addSpace_(const concepts::Space<G>& spc);
128
130 template<class G>
131 void storeData_(DenseMatrixCollection<G>& dense_ptr_);
132
134 uint data_;
135 };
136
137 template<class G, class F>
139 const std::string filename,
140 const concepts::Vector<F>& sol,
142 : concepts::MatfileIO(filename), DenseMatrixGraphics()
143 {
144 this->addSpace_(spc);
145 this->addSolution(spc, "u", sol, fun);
146 }
147
148
149 template<class G, class F>
151 const std::string filename,
152 const concepts::Vector<F>& sol,
153 const std::string varName,
155 :concepts::MatfileIO(filename), DenseMatrixGraphics()
156 {
157 this->addSpace_(spc);
158 this->addSolution(spc, varName, sol, fun);
159 }
160
161 template<class G>
163 const std::string filename) :
164 concepts::MatfileIO(filename), DenseMatrixGraphics() {
165
166 this->addSpace_(spc);
167 }
168
169 template<class G, class F>
171 const std::string filename, const concepts::ElementFormula<F, G>& frm) :
172 concepts::MatfileIO(filename) {
173 this->addSpace_(spc);
174 this->addFunction(spc, "u", frm);
175 }
176
177 template<class F, class G>
179 const std::string name,
180 const concepts::Vector<F>& sol,
182 {
183 // get matrix of the solution
185 function = this->getSolution(spc, sol, fun);
186 // store matrix
187 this->add(*function, name);
188 }
189
190 template<class F, class G>
192 const std::string name, const concepts::ElementFormula<F, G>& frm) {
193 // get matrix for the formula
195 this->getFunction(spc, frm);
196 // store matrix
197 this->add(*function, name);
198 }
199
200 template<class G>
202 DenseMatrixCollection<G> dmc = this->getSpace(spc);
203 //store matrix
204 this->storeData_(dmc);
205 }
206
207 //Save the matrices that hold informations
208 template<class G>
210 typename DenseMatrixCollection<G>::iterator i = dense_ptr.begin();
211 for (; i != dense_ptr.end(); ++i)
212 this->add(*i->second, i->first);
213 } // storeData_
214
215}
216// namespace graphics
217
218#endif // matlab_binary_hh
void add(const T &u, const std::string varName, enum matio_compression compress=MAT_COMPRESSION_NONE)
Definition matfileIO.hh:160
std::string filename() const
Definition matfileIO.hh:306
concepts::RCP< concepts::ElementMatrix< typename concepts::Datatype< F >::type > > getFunction(const concepts::Space< G > &spc, const concepts::ElementFormula< F, G > &frm)
concepts::RCP< concepts::ElementMatrix< F > > getSolution(const concepts::Space< G > &spc, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
DenseMatrixCollection< G > getSpace(const concepts::Space< G > &spc)
void addFunction(const concepts::Space< G > &spc, const std::string name, const concepts::ElementFormula< F, G > &frm)
MatlabBinaryGraphics(const std::string filename)
MatlabBinaryGraphics(concepts::Mesh &msh, const std::string filename, const uint points=5)
void storeData_(DenseMatrixCollection< G > &dense_ptr_)
Stores data hold by dense_ptr.
uint data_
Information which data should be stored.
void addSolution(const concepts::Space< G > &spc, const std::string name, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
void addSpace_(const concepts::Space< G > &spc)
MatlabBinaryGraphics(const concepts::Space< G > &spc, const std::string filename, std::vector< concepts::Vector< F > > &sol, const concepts::ElementFunction< F, G > *fun=0)