MCPcopy Create free account
hub / github.com/FreeFem/FreeFem-sources / addvector

Method addvector

plugin/seq/VTK_writer.cpp:167–183  ·  view source on GitHub ↗

!Add a field*/

Source from the content-addressed store, hash-verified

165
166 /*!Add a field*/
167 void addvector(const string &nameoffield, const Fem2D::Mesh *mesh, const KN< double > &val,
168 const KN< double > &val2) {
169 _ofdata.flags(std::ios_base::scientific);
170 _ofdata.precision(17);
171
172 _ofdata << "<DataArray type=\"Float32\" Name=\"";
173 _ofdata << nameoffield << "\" NumberOfComponents=\"3\" format=\"ascii\">";
174 _ofdata << std::endl;
175
176 for (int i = 0; i < val.size( ); ++i) {
177 _ofdata << checkprecision(val[i]) << " " << checkprecision(val2[i]) << " " << 0.0
178 << std::endl;
179 }
180
181 _ofdata << "</DataArray>" << std::endl;
182 _ofdata.flush( );
183 }
184
185 /*!Get the mesh associated with the series nameofts*/
186 const Fem2D::Mesh *getmeshts(const string &nameofts) { return _vecmesh[0]; }

Callers 1

VTK_writer.cppFile · 0.45

Calls 2

flushMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected