14#define MatlabGraphConstr_D 0
15#define MatlabMeshWriteFormula_D 0
130 const uint dim = 2,
const uint points = noPoints);
139 template<
class F,
class G>
150 template<
class F,
class G>
164 const uint dim = 2,
const uint points = noPoints);
174 template<
class F,
class G>
184 template<
class F,
class G>
192 template<
class F,
class G>
194 const uint points = 5);
196 static uint noPoints;
198 virtual std::ostream&
info(std::ostream& os)
const;
207 void createStreams_(
bool data);
209 void closeStreams_(
const uint& n);
212 std::map<std::string, std::ostream*> s_ptr_;
221 const std::string filename,
const uint dim)
227 BaseMeshCell matlab(s_ptr_, dim, concepts::ElementGraphicsBase::MATLAB);
230 write_(postProcess, matlab);
233 template<
class F,
class G>
235 const std::string filename,
244 concepts::ElementGraphicsBase::MATLAB, sol, fun);
247 write_(postProcess, matlab,
true);
250 template<
class F,
class G>
252 const std::string filename,
260 (s_ptr_, dim, concepts::ElementGraphicsBase::MATLAB, frm);
263 write_(postProcess, matlab,
true);
269 const uint dim,
const uint points)
275 concepts::ElementGraphicsBase::MATLAB, frm,
279 write_(postProcess, matlab,
true);
282 template<
class F,
class G>
289 template<
class F,
class G>
295 template<
class F,
class G>
307 createStreams_(data);
309 matlab.
count().assign(1, 0);
311 DEBUGL(MatlabGraphConstr_D, matlab);
315 closeStreams_(matlab.
n());
338 std::map<std::string, std::ostream*>& os,
340 bool boundary =
false,
bool coord =
true);
352 std::map<std::string, std::ostream*>& os,
363 std::map<std::string, std::ostream*>& os);
371 std::map<std::string, std::ostream*>& os);
373 std::map<std::string, std::ostream*>& os);
375 std::map<std::string, std::ostream*>& os,
378 virtual std::ostream&
info(std::ostream& os)
const;
381 std::map<std::string, std::ostream*>& os,
383 bool boundary =
false,
bool coord =
true);
385 std::map<std::string, std::ostream*>& os,
387 bool boundary =
false,
bool coord =
true);
389 std::map<std::string, std::ostream*>& os,
391 bool boundary =
false,
bool coord =
true);
397 std::map<std::string, std::ostream*>& os) {
399 *os[
"x"] << x[0] <<
" ";
402 *os[
"y"] << x[1] <<
" ";
405 *os[
"z"] << x[2] <<
" ";
412 std::map<std::string, std::ostream*>& os,
415 DEBUGL(MatlabMeshWriteFormula_D,
"cell = " << cell);
418 writeMesh(cell, os, np, cnt,
false,
false);
427 for (uint j = 0; j < np[1]; ++j) {
428 Real py = (Real)j / (np[1]-1);
429 for (uint i = 0; i < np[0]; ++i) {
430 x = cellQ->
chi((Real)i/(np[0]-1), py);
435 DEBUGL(MatlabMeshWriteFormula_D,
"f = " << f);
virtual Connector & connector() const =0
Returns the connector.
Real2d chi(Real xi, Real eta) const
std::vector< uint > & count()
Number of points written to the files, used for mesh representation.
virtual uint n() const =0
Number of components.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
MatlabGraphics(const concepts::Space< G > &spc, const std::string filename, const uint dim=2)
MatlabGraphics(concepts::Mesh &msh, const std::string filename, const uint dim=2, const uint points=noPoints)
void operator()(const concepts::Space< G > &spc, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
static void writeCoord(typename concepts::Point< Real, dim > x, std::map< std::string, std::ostream * > &os)
static void writeAttributes(const concepts::Connector &cntr, std::map< std::string, std::ostream * > &os)
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
static void writeFormula(const concepts::Cell &cell, std::map< std::string, std::ostream * > &os, const concepts::Array< uint > &np, uint &cnt, const concepts::PiecewiseFormulaBase< F > *frm)
static void writeMesh(const concepts::Cell &cell, std::map< std::string, std::ostream * > &os, const concepts::Array< uint > &np, uint &cnt, bool boundary=false, bool coord=true)
#define conceptsAssert(cond, exc)
#define DEBUGL(doit, msg)
Set< F > makeSet(uint n, const F &first,...)
std::string matlabEnding(const std::string &filename)
Returns a string with ".m" ending.