22template<
class Gr
idType>
25 enum {
dim = GridType::dimension};
28 FILE* fp = fopen(filename.
c_str(),
"w");
30 typedef typename GridType::template Codim<dim>::LevelIterator VertexIterator;
31 VertexIterator vit = grid.template lbegin<dim>(grid.
maxLevel());
32 VertexIterator vendit = grid.template lend<dim>(grid.
maxLevel());
34 for (; vit!=vendit; ++vit)
35 fprintf(fp,
"%g ", vit->geometry().corner(0)[0]);
49template<
class Gr
idType>
52 enum {
dim = GridType::dimension};
55 FILE* fp = fopen(filename.
c_str(),
"w");
57 typedef typename GridType::template Codim<dim>::LevelIterator VertexIterator;
60 for (
int i=0; i<2; i++) {
62 VertexIterator vit = grid[i]->template lbegin<dim>(grid[i]->
maxLevel());
63 VertexIterator vendit = grid[i]->template lend<dim>(grid[i]->
maxLevel());
65 for (; vit!=vendit; ++vit) {
67 fprintf(fp,
"%g ", vit->geometry().corner(0)[0]);
82template<
class VectorType>
83void write(FILE* fp,
const VectorType& u)
85 typedef typename VectorType::ConstIterator ConstIterator;
86 ConstIterator uIt = u.begin();
87 ConstIterator uEndIt = u.end();
89 for (; uIt!=uEndIt; ++uIt)
90 fprintf(fp,
"%g ", (*uIt)[0]);
97template<
class VectorType>
98void write(FILE* fp,
const VectorType& u,
int sd)
102 static int subDomain = 0;
106 <<
"is scheduled next!");
108 typedef typename VectorType::ConstIterator Iterator;
109 Iterator uIt = u.begin();
110 Iterator uEndIt = u.end();
112 for (; uIt!=uEndIt; ++uIt)
113 fprintf(fp,
"%3.15e ", (*uIt)[0]);
119 subDomain = (subDomain+1)%2;
void write(FILE *fp, const VectorType &u)
Append the content of v as one ascii line to fp.
Definition matlab_io.hh:83
FILE * openFileDD(const std::string &filename, const std::array< GridType *, 2 > &grid)
Open file for writing and write the coordinates of the grid vertices FOR TWO GRIDS.
Definition matlab_io.hh:50
FILE * openFile(const std::string &filename, GridType &grid)
Open file for writing and write the coordinates of the grid vertices.
Definition matlab_io.hh:23
#define DUNE_THROW(E,...)