G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gismo::internal Namespace Reference

This namespace contains functionalities that are internal to the library. More...

Functions

gsXmlNode * anyByTag (const std::string &tag, gsXmlNode *root)
 Helper to get any object (by tag) if one exists in the XML tree.
 
void appendBoxTopology (const gsBoxTopology &topology, gsXmlNode *node, gsXmlTree &data)
 Appends a box topology into node, used for gsMultiPatch and gsMultiBasis.
 
int countByTag (const std::string &tag, gsXmlNode *root)
 
int countByTagType (const std::string &tag, const std::string &type, gsXmlNode *root)
 
gsXmlNode * firstByTag (const std::string &tag, gsXmlNode *root)
 
gsXmlNode * firstByTagType (const std::string &tag, const std::string &type, gsXmlNode *root)
 
template<class Object >
Object * getById (gsXmlNode *node, const int &id)
 
template<class Object >
Object * getByLabel (gsXmlNode *node, const std::string &label)
 
template<class Object >
Object * getGeometryFromXml (gsXmlNode *node)
 Helper to fetch geometries.
 
template<class T >
void getMatrixFromXml (gsXmlNode *node, unsigned const &rows, unsigned const &cols, gsMatrix< T > &result, const std::string &base_type_flag="ascii")
 Helper to fetch matrices.
 
template<class T = real_t>
std::vector< gsBoundingBoxPair
< T > > 
getPotentialIntersectionRanges (const gsBSpline< T > &curve1, const gsBSpline< T > &curve2, const T MAX_CURVATURE)
 
template<class T >
void getSparseEntriesFromXml (gsXmlNode *node, gsSparseEntries< T > &result)
 Helper to fetch sparse entries.
 
bool gsExceptionHandler ()
 Exception handler.
 
gsXmlAttribute * makeAttribute (const std::string &name, const std::string &value, gsXmlTree &data)
 Helper to allocate XML attribute.
 
gsXmlAttribute * makeAttribute (const std::string &name, const unsigned &value, gsXmlTree &data)
 Helper to allocate XML attribute with unsigned int value.
 
gsXmlNode * makeComment (const std::string &, gsXmlTree &data)
 Helper to create an XML comment node.
 
template<short_t d, typename T >
void makeHierarchicalMesh (const gsHTensorBasis< d, T > &basis, std::vector< gsMesh< T > > &meshes, int n=0)
 Look at function gismo::makeHierarchicalMesh.
 
gsXmlNode * makeNode (const std::string &name, gsXmlTree &data)
 Helper to allocate XML node.
 
gsXmlNode * makeNode (const std::string &name, const std::string &value, gsXmlTree &data)
 Helper to allocate XML node with value.
 
template<class T >
gsXmlNode * makeNode (const std::string &name, const gsMatrix< T > &value, gsXmlTree &data, bool transposed=false)
 Helper to allocate XML node with gsMatrix value.
 
char * makeValue (const std::string &value, gsXmlTree &data)
 Helper to allocate XML value.
 
template<class T >
char * makeValue (const gsMatrix< T > &value, gsXmlTree &data, bool transposed)
 Helper to allocate matrix in XML pool.
 
template<class Object >
gsXmlNode * putGeometryToXml (Object const &obj, gsXmlTree &data)
 Helper to put geometries to XML.
 
template<class T >
gsXmlNode * putMatrixToXml (gsMatrix< T > const &mat, gsXmlTree &data, std::string name="Matrix")
 Helper to insert matrices into XML.
 
template<class T >
gsXmlNode * putSparseMatrixToXml (gsSparseMatrix< T > const &mat, gsXmlTree &data, std::string name="SparseMatrix")
 Helper to insert sparse matrices into XML.
 
gsXmlNode * searchId (const int id, gsXmlNode *root, const char *tag_name=NULL, const bool print_warning=true)
 
gsXmlNode * searchNode (gsXmlNode *root, const std::string &attr_name, const std::string &value, const char *tag_name=NULL)
 
std::string to_string (const unsigned &i)
 Helper to convert small unsigned to string.
 

Detailed Description

This namespace contains functionalities that are internal to the library.

Function Documentation

int countByTag ( const std::string &  tag,
gsXmlNode *  root 
)

Helper to count the number of Objects (by tag) that exist in the XML tree

int countByTagType ( const std::string &  tag,
const std::string &  type,
gsXmlNode *  root 
)

Helper to count the number of Objects (by name and type) that exist in the XML tree

gsXmlNode * firstByTag ( const std::string &  tag,
gsXmlNode *  root 
)

Helper to get the first object (by tag) if one exists in the XML tree

gsXmlNode * firstByTagType ( const std::string &  tag,
const std::string &  type,
gsXmlNode *  root 
)

Helper to get the first object (by tag and type) if one exists in the XML tree

Object* gismo::internal::getById ( gsXmlNode *  node,
const int &  id 
)

Helper to read an object by a given id value:

Parameters
nodeparent node, we check his children to get the given id
id
Object* gismo::internal::getByLabel ( gsXmlNode *  node,
const std::string &  label 
)

Helper to read an object by a given label :

Parameters
nodeparent node, we check his children to get the given label
label
std::vector<gsBoundingBoxPair<T> > gismo::internal::getPotentialIntersectionRanges ( const gsBSpline< T > &  curve1,
const gsBSpline< T > &  curve2,
const T  MAX_CURVATURE 
)

compute potential intersection range by recursively subdividing curves and bounding box intersection detection

Parameters
curve1first B-Spline curve
curve2second B-Spline curve
MAX_CURVATUREmaximum curvature for recursive subdivision
Note
MAX_CURVATURE should be set to a value slightly larger than 1.0, say, 1.0+1e-6
Returns
a list of potential intersection ranges for the two input
gsXmlNode* gismo::internal::searchId ( const int  id,
gsXmlNode *  root,
const char *  tag_name = NULL,
const bool  print_warning = true 
)
inline

Helper to fetch a node with a certain id value.

Parameters
rootparent node, we check his children for the given id
idthe ID number which is seeked for
tag_nameLimit search to tags named tag_name .
print_warningPrint warning if search was not successful
gsXmlNode* gismo::internal::searchNode ( gsXmlNode *  root,
const std::string &  attr_name,
const std::string &  value,
const char *  tag_name = NULL 
)
inline

Helper to fetch a node with a certain attribute value.

Parameters
rootparent node, we check if it's children attribute value matches the given value
attr_nameAttribute's name
valuethe attribute's value number which is seeked for
tag_nameLimit search to tags named tag_name .