Commit 5ef50174 authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#1344 GeometricEltFactory: add a new way to build a geometric element useful...

#1344 GeometricEltFactory: add a new way to build a geometric element useful for post-processing purposes. That should not be used in a model - the comment says so explicitly.
parent 7bae68ae
......@@ -107,6 +107,19 @@ namespace MoReFEM
Utilities::PrintKeys(callbacks_ensight_, oconv, ", ", "[", "]");
return oconv.str();
}
GeometricElt::unique_ptr GeometricEltFactory::CreateFromIdentifier(Advanced::GeometricEltEnum identifier,
unsigned int mesh_unique_id) const
{
const auto it = callbacks_.find(identifier);
if (it == callbacks_.cend())
throw ExceptionNS::Factory::GeometricElt::InvalidGeometricEltId(identifier,
__FILE__, __LINE__);
return it->second(mesh_unique_id);
}
} // namespace Advanced
......
......@@ -153,6 +153,22 @@ namespace MoReFEM
const std::string& geometric_elt_name,
std::istream& stream) const;
/*!
* \brief Create an object according to its unique identifier.
*
* \param[in] identifier Identifier of the object (member of GeometricEltEnum)
* If the id given as argument is invalid an exception is thrown.
* \param[in] mesh_unique_id Unique identifier of the mesh.
*
* \attention This method shouldn't be used when defining a model; it has been introduced for the sake of
* post-processing specific operations.
*
* \return Pointer to a newly created object.
*/
GeometricElt::unique_ptr CreateFromIdentifier(Advanced::GeometricEltEnum identifier,
unsigned int mesh_unique_id) const;
/*!
* \brief Returns the shared pointer to the RefGeomElt related to GeometricEltEnum.
*
......
......@@ -154,7 +154,6 @@ namespace MoReFEM
}
inline GeometricEltFactory::CallBack::size_type GeometricEltFactory::NgeometricElt() const
{
return callbacks_.size();
......
......@@ -611,8 +611,8 @@ namespace MoReFEM
if (medit_dimension < 2 || medit_dimension > 3)
throw MeditExceptionNS::InvalidDimension(medit_filename,
medit_dimension,
__FILE__, __LINE__);
medit_dimension,
__FILE__, __LINE__);
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment