31 template<
class T>
class gsMultiPatch;
41 template<
class T = real_t >
99 m_data.getAnyFirst(result);
120 memory::unique_ptr< gsMultiPatch<T> > mp =
121 this->
operator memory::unique_ptr< gsMultiPatch<T> >();
139 operator memory::unique_ptr<Obj> ()
142 if ( this->
m_data.template hasAny< Obj >() )
143 return this->
m_data.template getAnyFirst< Obj >();
145 gsWarn<<
"Failed to read object from file (not found).\n";
146 return memory::unique_ptr<Obj>();
150 operator memory::unique_ptr< gsGeometry<T> > ()
156 gsWarn<<
"Failed to read gsGeometry from file (not found).\n";
157 return memory::unique_ptr< gsGeometry<T> >();
161 operator memory::unique_ptr< gsCurve<T> > ()
167 gsWarn<<
"Failed to read gsCurve from file (not found).\n";
168 return memory::unique_ptr< gsCurve<T> >();
172 operator memory::unique_ptr< gsBasis<T> > ()
178 gsWarn<<
"Failed to read gsBasis from file (not found).\n";
179 return memory::unique_ptr< gsBasis<T> >();
183 operator memory::unique_ptr< gsFunctionExpr<T> > ()
const
189 return this->
m_data.template getAnyFirst< gsFunctionExpr<T> >();
191 return this->
m_data.template getId<gsFunctionExpr<T> >(m_id);
194 gsWarn<<
"Failed to read gsFunctionExpr from file (not found).\n";
195 return memory::unique_ptr< gsFunctionExpr<T> >();
199 operator memory::unique_ptr< gsPlanarDomain<T> > ()
205 gsWarn<<
"Failed to read gsPlanarDomain from file (not found).\n";
206 return memory::unique_ptr< gsPlanarDomain<T> >();
210 operator memory::unique_ptr< gsMultiPatch<T> > ()
219 std::vector< memory::unique_ptr<gsGeometry<T> > > patches =
220 this->
m_data.template getAll< gsGeometry<T> >();
221 std::vector< gsGeometry<T>* > releasedPatches =
memory::release(patches);
225 gsWarn<<
"Failed to read gsMultiPatch from file (not found).\n";
226 return memory::unique_ptr< gsMultiPatch<T> >();
230 operator memory::unique_ptr< gsMesh<T> > ()
236 gsWarn<<
"Failed to read gsMesh from file (not found).\n";
237 return memory::unique_ptr< gsMesh<T> >();
241 operator std::vector< memory::unique_ptr< gsBasis<T> > > ()
244 return this->
m_data.template getAll< gsBasis<T> >();
248 operator memory::unique_ptr< gsPde<T> > ()
253 gsWarn<<
"Failed to read gsPde from file (not found).\n";
254 return memory::unique_ptr< gsPde<T> >();
258 operator memory::unique_ptr< gsPoissonPde<T> > ()
263 gsWarn<<
"Failed to read gsPoissonPde from file (not found).\n";
264 return memory::unique_ptr< gsPoissonPde<T> >();
269 operator memory::shared_ptr<Obj> ()
271 return (memory::unique_ptr<Obj>)(*this);
276 #ifdef GISMO_WITH_PYBIND11
281 void pybind11_init_gsReadFile(pybind11::module &m);
283 #endif // GISMO_WITH_PYBIND11
287 template <
typename Object>
288 void gsWrite(
const Object& obj,
const std::string& fname)
unique_ptr< T > make_unique(T *x)
Definition: gsMemory.h:198
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
std::vector< T * > release(std::vector< unique_ptr< T > > &cont)
Takes a vector of smart pointers, releases them and returns the corresponding raw pointers...
Definition: gsMemory.h:228
void clear()
Clear (delete) all patches.
Definition: gsMultiPatch.h:319
Abstract base class representing a curve.
Definition: gsCurve.h:30
S give(S &x)
Definition: gsMemory.h:266
Abstract class representing a PDE (partial differential equation).
Definition: gsPde.h:43
gsFileData< T > m_data
File data as a Gismo xml tree.
Definition: gsReadFile.h:131
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
This file contains the debugging and messaging system of G+Smo.
Class Representing a triangle mesh with 3D vertices.
Definition: gsMesh.h:31
#define gsWarn
Definition: gsDebug.h:50
gsReadFile(std::string const &fn, index_t id)
Opens a file and reads an object into a smartpointer (uPtr).
Definition: gsReadFile.h:75
A Poisson PDE.
Definition: gsPoissonPde.h:34
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
void dump(String const &fname="dump") const
Dump file contents to an xml file.
Definition: gsFileData.hpp:86
Class representing a Planar domain with an outer boundary and a number of holes.
Definition: gsPlanarDomain.h:43
gsReadFile(std::string const &fn)
Opens a file and reads an object into a smartpointer (uPtr).
Definition: gsReadFile.h:65
Reads an object from a data file, if such the requested object exists in the file.
Definition: gsReadFile.h:42
Class defining a multivariate (real or vector) function given by a string mathematical expression...
Definition: gsFunctionExpr.h:51
gsReadFile(std::string const &fn, Obj &result)
Opens a file and reads an object into result.
Definition: gsReadFile.h:95
gsReadFile(std::string const &fn, gsMultiPatch< T > &result)
Opens a file and reads a gsMultiPatch object into result.
Definition: gsReadFile.h:115
This class represents an XML data tree which can be read from or written to a (file) stream...
Definition: gsFileData.h:33
void gsWrite(const Object &obj, const std::string &fname)
Write an arbitrary Gismo object to an XML file with the given filename.
Definition: gsReadFile.h:288
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78