37 template <
short_t d,
typename T>
59 out << std::setprecision(15);
61 out << bspl.
geoDim() <<
" " << 0 <<
"\n";
65 out << bspl.
basis().size(dim) <<
" " <<
66 bspl.
basis().degree(dim) + 1 <<
"\n";
69 typename gsKnotVector<T>::const_iterator iter;
70 for (iter = kv.
begin(); iter != kv.
end(); iter++)
79 for (
int row = 0; row < coefs.rows(); row++)
81 out << coefs.row(row) <<
"\n";
93 template <
short_t d,
typename T>
124 gsWarn <<
"Dimension is too high: GoTools does not support dimension "
132 gsWriteGoToolsBodySpline<d, T>(bspl, out);
141 template <
typename T>
143 const std::string& fileName)
145 std::string fn(fileName);
156 file.open(fn.c_str());
159 gsWarn <<
"Can not open file: " << fileName <<
"\n"
175 template <
typename T>
184 if (bspline1 != NULL)
186 gsWriteGoToolsSpline<1, T>(*bspline1, out);
193 if (bspline2 != NULL)
195 gsWriteGoToolsSpline<2, T>(*bspline2, out);
202 if (bspline3 != NULL)
204 gsWriteGoToolsSpline<3, T>(*bspline3, out);
208 gsWarn <<
"Can not write your geometry, unsupported format.\n"
209 "Currently supported formats: BSplines.\n"
220 template <
typename T>
222 const std::string& fileName)
224 std::string fn(fileName);
235 file.open(fn.c_str());
238 gsWarn <<
"Can not open file: " << fileName <<
"\n"
243 typename gsMultiPatch<T>::const_iterator iter;
244 for (iter = multiPatch.
begin(); iter != multiPatch.
end(); ++iter)
246 gsWriteGoTools<T>(**iter, file);
Provides definition of HTensorBasis abstract interface.
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
Provides declaration of iterator of hierarchical domain.
void gsWriteGoToolsSpline(const gsTensorBSpline< d, T > &bspl, std::ofstream &out)
Definition: gsGoTools.h:94
#define short_t
Definition: gsConfig.h:35
A tensor product of d B-spline functions, with arbitrary target dimension.
Definition: gsTensorBSpline.h:44
static std::string getExtension(std::string const &fn)
Returns the extension of the filename fn.
Definition: gsFileManager.cpp:568
Provides combinatorial unitilies.
#define gsWarn
Definition: gsDebug.h:50
Utility class which holds I/O XML data to read/write to/from files.
const_iterator end() const
Definition: gsMultiPatch.h:108
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
short_t parDim() const
Dimension d of the parameter domain (same as domainDim()).
Definition: gsGeometry.hpp:190
Provides declaration of the Mesh class.
iterator end() const
Returns iterator pointing past the end of the repeated knots.
Definition: gsKnotVector.hpp:124
void gsWriteGoToolsBodySpline(const gsTensorBSpline< d, T > &bspl, std::ofstream &out)
Writes body part of GoTools (.g2) format to a file.
Definition: gsGoTools.h:38
Utility class for finding files and handling paths.
Class for representing a knot vector.
Definition: gsKnotVector.h:79
void gsWriteGoTools(const gsGeometry< T > &geom, const std::string &fileName)
Definition: gsGoTools.h:142
const_iterator begin() const
Definition: gsMultiPatch.h:103
iterator begin() const
Returns iterator pointing to the beginning of the repeated knots.
Definition: gsKnotVector.hpp:117
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
short_t geoDim() const
Dimension n of the absent physical space.
Definition: gsGeometry.h:292
gsMatrix< T > & coefs()
Definition: gsGeometry.h:340