31template<
class T>
class gsMultiPatch;
41template<
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> > ()
164 if ( this->m_data.template hasAny<
gsCurve<T> >() )
165 return this->m_data.template getAnyFirst<
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> > ()
175 if ( this->m_data.template hasAny<
gsBasis<T> >() )
176 return this->m_data.template getAnyFirst<
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> > ()
233 if ( this->m_data.template has<
gsMesh<T> >() )
234 return this->m_data.template getFirst<
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> > ()
250 if ( this->m_data.template has<
gsPde<T> >() )
251 return this->m_data.template getFirst<
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);
287template <
typename Object>
288void gsWrite(
const Object& obj,
const std::string& fname)
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
Abstract base class representing a curve.
Definition gsCurve.h:31
This class represents an XML data tree which can be read from or written to a (file) stream.
Definition gsFileData.h:34
Class defining a multivariate (real or vector) function given by a string mathematical expression.
Definition gsFunctionExpr.h:52
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
Class Representing a triangle mesh with 3D vertices.
Definition gsMesh.h:32
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
void clear()
Clear (delete) all patches.
Definition gsMultiPatch.h:388
Abstract class representing a PDE (partial differential equation).
Definition gsPde.h:44
Class representing a Planar domain with an outer boundary and a number of holes.
Definition gsPlanarDomain.h:44
A Poisson PDE.
Definition gsPoissonPde.h:35
Reads an object from a data file, if such the requested object exists in the file.
Definition gsReadFile.h:43
gsReadFile(std::string const &fn, gsMultiPatch< T > &result)
Opens a file and reads a gsMultiPatch object into result.
Definition gsReadFile.h:115
gsReadFile(std::string const &fn, index_t id)
Opens a file and reads an object into a smartpointer (uPtr).
Definition gsReadFile.h:75
gsReadFile(std::string const &fn, Obj &result)
Opens a file and reads an object into result.
Definition gsReadFile.h:95
gsFileData< T > m_data
File data as a Gismo xml tree.
Definition gsReadFile.h:131
gsReadFile(std::string const &fn)
Opens a file and reads an object into a smartpointer (uPtr).
Definition gsReadFile.h:65
#define index_t
Definition gsConfig.h:32
This file contains the debugging and messaging system of G+Smo.
#define gsWarn
Definition gsDebug.h:50
#define GISMO_ENSURE(cond, message)
Definition gsDebug.h:102
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
unique_ptr< T > make_unique(T *x)
Definition gsMemory.h:198
The G+Smo namespace, containing all definitions for the library.
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
S give(S &x)
Definition gsMemory.h:266