Skip to content
Snippets Groups Projects
Commit d1101897 authored by Tom Fischer's avatar Tom Fischer
Browse files

[FileIO] GMSHInterface: remove static method.

Functionality is avaiable from other methods of the class.
parent 52a49831
No related branches found
No related tags found
No related merge requests found
......@@ -74,45 +74,6 @@ GMSHInterface::~GMSHInterface()
delete polygon_tree;
}
int GMSHInterface::writeGeoFile(GeoLib::GEOObjects &geo_objects, std::string const& file_name)
{
std::vector<std::string> names;
geo_objects.getGeometryNames(names);
if (names.empty())
{
ERR ("No geometry information available.");
return 1;
}
bool const multiple_geometries = (names.size() > 1);
std::string merge_name("MergedGeometry");
if (multiple_geometries)
{
if (geo_objects.mergeGeometries (names, merge_name) != 1)
return 2;
names.clear();
names.push_back(merge_name);
}
else
merge_name = names[0];
// default parameters for GMSH interface
double param1(0.5); // mesh density scaling on normal points
double param2(0.05); // mesh density scaling on station points
std::size_t param3(2); // points per leaf
GMSHInterface gmsh_io(geo_objects, true, FileIO::GMSH::MeshDensityAlgorithm::AdaptiveMeshDensity, param1, param2, param3, names);
int const writer_return_val = gmsh_io.writeToFile(file_name);
if (multiple_geometries)
{
geo_objects.removeSurfaceVec(merge_name);
geo_objects.removePolylineVec(merge_name);
geo_objects.removePointVec(merge_name);
}
return (writer_return_val==1) ? 0 : 3;
}
bool GMSHInterface::isGMSHMeshFile(const std::string& fname)
{
std::ifstream input(fname.c_str());
......
......@@ -91,14 +91,6 @@ public:
*/
static MeshLib::Mesh* readGMSHMesh (std::string const& fname);
/**
* Export script for writing geo files.
* To do this, all geometries currently loaded are merged, the merged result is written to a
* file and then the merged geometry is removed again.
* @return error code, i.e. 0 = okay, 1 = geo_objects is empty, 2 = error while merging, 3 = error writing file
*/
static int writeGeoFile(GeoLib::GEOObjects &geo_objects, std::string const& file_name);
protected:
bool write();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment