diff --git a/Applications/Utils/FileConverter/CMakeLists.txt b/Applications/Utils/FileConverter/CMakeLists.txt index ec0b9d4c72d625257d02759f82a866e3def4143c..153b1867b914d8a06b207757ab6f8f4e079a7beb 100644 --- a/Applications/Utils/FileConverter/CMakeLists.txt +++ b/Applications/Utils/FileConverter/CMakeLists.txt @@ -18,9 +18,6 @@ if (QT4_FOUND) add_executable(generateBCandGLI generateBCandGLI.cpp ) target_link_libraries(generateBCandGLI FileIO) - add_executable(generateBCFromPolyline generateBCFromPolyline.cpp ) - target_link_libraries(generateBCFromPolyline FileIO) - set_target_properties(generateBCandGLI generateBCFromPolyline PROPERTIES FOLDER Utilities) @@ -68,7 +65,7 @@ install(TARGETS generateMatPropsFromMatID GMSH2OGS OGS2VTK VTK2OGS VTK2TIN RUNTIME DESTINATION bin COMPONENT ogs_converter) if(QT4_FOUND) - install(TARGETS ConvertSHPToGLI generateBCandGLI generateBCFromPolyline generateBCandGLI + install(TARGETS ConvertSHPToGLI generateBCandGLI generateBCandGLI FEFLOW2OGS RUNTIME DESTINATION bin COMPONENT ogs_converter) endif() diff --git a/Applications/Utils/FileConverter/generateBCFromPolyline.cpp b/Applications/Utils/FileConverter/generateBCFromPolyline.cpp deleted file mode 100644 index e54afee9119123d23c9d1a84255bf3a6db3c396f..0000000000000000000000000000000000000000 --- a/Applications/Utils/FileConverter/generateBCFromPolyline.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/** - * \file - * \author Thomas Fischer - * \date 2011-03-08 - * \brief Implementation of the generateBCFromPolyline tool. - * - * \copyright - * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org) - * Distributed under a Modified BSD License. - * See accompanying file LICENSE.txt or - * http://www.opengeosys.org/project/license - * - */ - -#include <fstream> - -#include <QString> - -// GeoLib -#include "GEOObjects.h" -#include "PolylineVec.h" - -// OGS -#include "Applications/ApplicationsLib/ProjectData.h" - -// FileIO -#include "XmlIO/Qt/XmlGmlInterface.h" - -int main (int argc, char* argv[]) -{ - if (argc == 1) - { - std::cout << "Usage: " << argv[0] << " gml-file" << std::endl; - std::cout << "\tgives you the name of all polylines in the file" << std::endl; - std::cout << "Usage: " << argv[0] << " gml-file polyline-to-convert" << std::endl; - std::cout << "\tcreates for the given polyline points boundary conditions" << - std::endl; - return -1; - } - - GeoLib::GEOObjects geo_objs; - FileIO::XmlGmlInterface xml(geo_objs); - std::string fname (argv[1]); - xml.readFile(QString::fromStdString (fname)); - - std::vector<std::string> geo_names; - geo_objs.getGeometryNames (geo_names); - if (geo_names.empty ()) - { - std::cout << "no geometries found" << std::endl; - return -1; - } - const GeoLib::PolylineVec* ply_vec (geo_objs.getPolylineVecObj(geo_names[0])); - if (!ply_vec) - { - std::cout << "could not found polylines" << std::endl; - return -1; - } - const std::size_t n_ply (ply_vec->size()); - - std::vector<std::size_t> ply_pnt_ids; - for (std::size_t k(0); k < n_ply; k++) - { - std::string ply_name; - if (ply_vec->getNameOfElementByID(k, ply_name)) - { - if (argc == 2) - std::cout << "polyline " << k << ": " << ply_name << std::endl; - else if (ply_name.find (argv[2]) != std::string::npos) - { - std::cout << "found polyline " << ply_name << std::endl; - GeoLib::Polyline const* ply (ply_vec->getElementByName(ply_name)); - const std::size_t n_ply_pnts (ply->getNumberOfPoints()); - for (std::size_t j(0); j < n_ply_pnts; j++) - ply_pnt_ids.push_back (ply->getPointID(j)); - } - } - } - - if (argc == 2) - return 0; - - std::vector<GeoLib::Point*> const* geo_pnts (geo_objs.getPointVec(geo_names[0])); - // write gli file and bc file - std::ofstream gli_out ("TB.gli"); - std::ofstream bc_out ("TB.bc"); - bc_out << "// file generated by " << argv[0] << "\n"; - if (gli_out && bc_out) - { - gli_out << "#POINTS" << "\n"; - for (std::size_t k(0); k < ply_pnt_ids.size(); k++) - { - gli_out << k << " " << *((*geo_pnts)[ply_pnt_ids[k]]) << " $NAME PLYPNT" << - argv[2] << k << "\n"; - // boundary condition - bc_out << "#BOUNDARY_CONDITION" << "\n"; - bc_out << "\t$PCS_TYPE" << "\n" << "\t\tGROUNDWATER_FLOW" << "\n"; - bc_out << "\t$PRIMARY_VARIABLE" << "\n" << "\t\tHEAD" << "\n"; - bc_out << "\t$GEO_TYPE" << "\n" << "\t\tPOINT PLYPNT" << argv[2] << - k << "\n"; - bc_out << "\t$DIS_TYPE" << "\n" << "\t\tCONSTANT " << - (*((*geo_pnts)[ply_pnt_ids[k]]))[2] << "\n"; - } - gli_out << "#STOP" << "\n"; - bc_out << "#STOP" << "\n"; - gli_out.close (); - bc_out.close (); - } -}