diff --git a/FileIO/GMSInterface.cpp b/FileIO/GMSInterface.cpp index 24a0944f53e21d1e087a6992b895b7e272713d04..85f34eb46df7fc965a404b82bd6de888cba3ed54 100644 --- a/FileIO/GMSInterface.cpp +++ b/FileIO/GMSInterface.cpp @@ -135,7 +135,7 @@ void GMSInterface::writeBoreholesToGMS(const std::vector<GeoLib::Point*>* statio // write header out << "name" << "\t" << std::fixed << "X" << "\t" << "Y" << "\t" << "Z" << "\t" << - "soilID" << std::endl; + "soilID" << "\n"; for (std::size_t j = 0; j < stations->size(); j++) { @@ -154,17 +154,17 @@ void GMSInterface::writeBoreholesToGMS(const std::vector<GeoLib::Point*>* statio //idx = getSoilID(soilID, soilNames[i]); current_soil_name = soilNames[i]; - out << station->getName() << "\t" << std::fixed + out << station->getName() << "\t" << std::fixed << (*(profile[i - 1]))[0] << "\t" - << (*(profile[i - 1]))[1] << "\t" + << (*(profile[i - 1]))[1] << "\t" << (*(profile[i - 1]))[2] << "\t" - << current_soil_name/*idx*/ << std::endl; + << current_soil_name/*idx*/ << "\n"; } out << station->getName() << "\t" << std::fixed << (*(profile[nLayers - 1]))[0] << "\t" - << (*(profile[nLayers - 1]))[1] << "\t" + << (*(profile[nLayers - 1]))[1] << "\t" << (*(profile[nLayers - 1]))[2] << "\t" - << current_soil_name << std::endl; // this line marks the end of the borehole + << current_soil_name << "\n"; // this line marks the end of the borehole } out.close(); @@ -186,12 +186,12 @@ int GMSInterface::writeSoilIDTable(const std::vector<std::string> &soilID, std::ofstream out( filename.c_str(), std::ios::out ); // write header - out << "ID" << "\t" << std::fixed << "Soil name" << std::endl; + out << "ID" << "\t" << std::fixed << "Soil name" << "\n"; // write table std::size_t nIDs = soilID.size(); for (std::size_t i = 0; i < nIDs; i++) - out << i << "\t" << std::fixed << soilID[i] << "\t" << std::endl; + out << i << "\t" << std::fixed << soilID[i] << "\t" << "\n"; out.close(); return 1; diff --git a/FileIO/Legacy/OGSIOVer4.cpp b/FileIO/Legacy/OGSIOVer4.cpp index fbc583aeccab491abf1359b62b0aa809f4403b4a..944c43a0c80acc369cf192a152bae02e05322c41 100644 --- a/FileIO/Legacy/OGSIOVer4.cpp +++ b/FileIO/Legacy/OGSIOVer4.cpp @@ -567,14 +567,14 @@ void writeGLIFileV4 (const std::string& fname, std::string pnt_name; const size_t n_pnts(pnts->size()); INFO("GeoLib::writeGLIFileV4(): writing %d points to file %s.", n_pnts, fname.c_str()); - os << "#POINTS" << std::endl; + os << "#POINTS" << "\n"; os.precision (20); for (size_t k(0); k < n_pnts; k++) { - os << k << " " << *((*pnts)[k]) << std::flush; + os << k << " " << *((*pnts)[k]); if (pnt_vec->getNameOfElementByID(k, pnt_name)) { - os << " $NAME " << pnt_name << std::flush; + os << " $NAME " << pnt_name; } - os << std::endl; + os << "\n"; } } @@ -586,13 +586,13 @@ void writeGLIFileV4 (const std::string& fname, plys->size (), fname.c_str()); for (size_t k(0); k < plys->size(); k++) { - os << "#POLYLINE" << std::endl; + os << "#POLYLINE" << "\n"; std::string polyline_name; plys_vec->getNameOfElement((*plys)[k], polyline_name); - os << " $NAME " << std::endl << " " << polyline_name << std::endl; - os << " $POINTS" << std::endl; + os << " $NAME " << "\n" << " " << polyline_name << "\n"; + os << " $POINTS" << "\n"; for (size_t j(0); j < (*plys)[k]->getNumberOfPoints(); j++) - os << " " << ((*plys)[k])->getPointID(j) << std::endl; + os << " " << ((*plys)[k])->getPointID(j) << "\n"; } } @@ -604,14 +604,14 @@ void writeGLIFileV4 (const std::string& fname, for (size_t k(0); k < plys->size(); k++) if ((*plys)[k]->isClosed()) { - os << "#SURFACE" << std::endl; - os << " $NAME " << std::endl << " " << k << std::endl; //plys_vec->getNameOfElement ((*plys)[k]) << std::endl; - os << " $TYPE " << std::endl << " 0" << std::endl; - os << " $POLYLINES" << std::endl << " " << k << std::endl; //plys_vec->getNameOfElement ((*plys)[k]) << std::endl; + os << "#SURFACE" << "\n"; + os << " $NAME " << "\n" << " " << k << "\n"; //plys_vec->getNameOfElement ((*plys)[k]) << std::endl; + os << " $TYPE " << "\n" << " 0" << "\n"; + os << " $POLYLINES" << "\n" << " " << k << "\n"; //plys_vec->getNameOfElement ((*plys)[k]) << std::endl; } } - os << "#STOP" << std::endl; + os << "#STOP" << "\n"; os.close (); } @@ -630,7 +630,7 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects pnts_id_offset.push_back (0); // writing all points - os << "#POINTS" << std::endl; + os << "#POINTS" << "\n"; for (size_t j(0); j < geo_names.size(); j++) { os.precision (20); @@ -640,11 +640,11 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects std::string pnt_name; const size_t n_pnts(pnts->size()); for (size_t k(0); k < n_pnts; k++) { - os << pnts_offset + k << " " << *((*pnts)[k]) << std::flush; + os << pnts_offset + k << " " << *((*pnts)[k]); if (pnt_vec->getNameOfElementByID(k, pnt_name)) { - os << " $NAME " << pnt_name << std::flush; + os << " $NAME " << pnt_name; } - os << std::endl; + os << "\n"; } pnts_offset += pnts->size(); pnts_id_offset.push_back (pnts_offset); @@ -664,8 +664,7 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects { for (size_t k(0); k < pnts->size(); k++) os << k + pnts_offset << " " << *((*pnts)[k]) << " $NAME " << - static_cast<GeoLib::Station*>((*pnts)[k])->getName() << - std::endl; + static_cast<GeoLib::Station*>((*pnts)[k])->getName() << "\n"; pnts_offset += pnts->size(); pnts_id_offset.push_back (pnts_offset); } @@ -680,18 +679,18 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects if (plys_vec) { const std::vector<GeoLib::Polyline*>* plys (plys_vec->getVector()); for (size_t k(0); k < plys->size(); k++) { - os << "#POLYLINE" << std::endl; + os << "#POLYLINE" << "\n"; std::string ply_name; if (plys_vec->getNameOfElementByID (plys_cnt, ply_name)) - os << "\t$NAME " << std::endl << "\t\t" << ply_name << - std::endl; + os << "\t$NAME " << "\n" << "\t\t" << ply_name << + "\n"; else - os << "\t$NAME " << std::endl << "\t\t" << geo_names[j] << - "-" << plys_cnt << std::endl; - os << "\t$POINTS" << std::endl; + os << "\t$NAME " << "\n" << "\t\t" << geo_names[j] << + "-" << plys_cnt << "\n"; + os << "\t$POINTS" << "\n"; for (size_t l(0); l < (*plys)[k]->getNumberOfPoints(); l++) os << "\t\t" << pnts_id_offset[j] + - ((*plys)[k])->getPointID(l) << std::endl; + ((*plys)[k])->getPointID(l) << "\n"; plys_cnt++; } } @@ -706,17 +705,17 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects const std::vector<GeoLib::Surface*>* sfcs (sfcs_vec->getVector()); for (size_t k(0); k < sfcs->size(); k++) { - os << "#SURFACE" << std::endl; + os << "#SURFACE" << "\n"; std::string sfc_name(path); if (sfcs_vec->getNameOfElementByID (sfcs_cnt, sfc_name)) { - os << "\t$NAME " << std::endl << "\t\t" << sfc_name << std::endl; + os << "\t$NAME " << "\n" << "\t\t" << sfc_name << "\n"; } else { - os << "\t$NAME " << std::endl << "\t\t" << sfcs_cnt << std::endl; + os << "\t$NAME " << "\n" << "\t\t" << sfcs_cnt << "\n"; sfc_name += BaseLib::number2str (sfcs_cnt); } sfc_name += ".tin"; - os << "\t$TIN" << std::endl; - os << "\t\t" << sfc_name << std::endl; + os << "\t$TIN" << "\n"; + os << "\t\t" << sfc_name << "\n"; // create tin file std::ofstream tin_os (sfc_name.c_str()); GeoLib::Surface const& sfc (*(*sfcs)[k]); @@ -725,7 +724,7 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects GeoLib::Triangle const& tri (*(sfc[l])); tin_os << l << " " << *(tri.getPoint(0)) << " " << *(tri.getPoint(1)) << " " << *(tri.getPoint(2)) << - std::endl; + "\n"; } tin_os.close(); @@ -734,7 +733,7 @@ void writeAllDataToGLIFileV4 (const std::string& fname, const GeoLib::GEOObjects } } - os << "#STOP" << std::endl; + os << "#STOP" << "\n"; os.close (); } } // end namespace diff --git a/MeshLib/Mesh2MeshPropertyInterpolation.cpp b/MeshLib/Mesh2MeshPropertyInterpolation.cpp index 9575f91cb5b41a1f34457b33ea5ba02b16fcdc94..025b50e87394a3930aa8ed7d11a420d275ee34ae 100644 --- a/MeshLib/Mesh2MeshPropertyInterpolation.cpp +++ b/MeshLib/Mesh2MeshPropertyInterpolation.cpp @@ -113,27 +113,27 @@ void Mesh2MeshPropertyInterpolation::interpolatePropertiesForMesh(Mesh *dest_mes std::string aabb_fname(base_name + "-aabb.gli"); std::ofstream out_aabb(aabb_fname.c_str()); - out_aabb << "#POINTS" << std::endl; - out_aabb << "0 " << elem_aabb.getMinPoint() << std::endl; - out_aabb << "1 " << elem_aabb.getMaxPoint() << std::endl; - out_aabb << "#STOP" << std::endl; + out_aabb << "#POINTS" << "\n"; + out_aabb << "0 " << elem_aabb.getMinPoint() << "\n"; + out_aabb << "1 " << elem_aabb.getMaxPoint() << "\n"; + out_aabb << "#STOP" << "\n"; out_aabb.close(); std::string source_fname(base_name + "-SourceNodes.gli"); std::ofstream out_src(source_fname.c_str()); - out_src << "#POINTS" << std::endl; + out_src << "#POINTS" << "\n"; size_t nodes_cnt(0); for (size_t i(0); i<nodes.size(); ++i) { std::vector<MeshLib::Node*> const* i_th_vec(nodes[i]); const size_t n_nodes_in_vec(i_th_vec->size()); for (size_t j(0); j<n_nodes_in_vec; j++) { MeshLib::Node const*const j_th_node((*i_th_vec)[j]); - out_src << nodes_cnt << " " << *(dynamic_cast<GeoLib::Point const*>(j_th_node)) << std::endl; + out_src << nodes_cnt << " " << *(dynamic_cast<GeoLib::Point const*>(j_th_node)) << "\n"; nodes_cnt++; } } - out_src << "#STOP" << std::endl; + out_src << "#STOP" << "\n"; out_src.close(); std::cerr << "no source nodes in dest element " << k << std::endl; } diff --git a/Utils/FileConverter/generateBCFromPolyline.cpp b/Utils/FileConverter/generateBCFromPolyline.cpp index 507bbbd0a4846c6aef8a26f30dd824c4cb9be7a5..bea095a791017f106148f0b6d0d20a68e9dea680 100644 --- a/Utils/FileConverter/generateBCFromPolyline.cpp +++ b/Utils/FileConverter/generateBCFromPolyline.cpp @@ -87,25 +87,25 @@ int main (int argc, char* argv[]) // 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] << std::endl; + bc_out << "// file generated by " << argv[0] << "\n"; if (gli_out && bc_out) { - gli_out << "#POINTS" << std::endl; + gli_out << "#POINTS" << "\n"; for (size_t k(0); k < ply_pnt_ids.size(); k++) { gli_out << k << " " << *((*geo_pnts)[ply_pnt_ids[k]]) << " $NAME PLYPNT" << - argv[2] << k << std::endl; + argv[2] << k << "\n"; // boundary condition - bc_out << "#BOUNDARY_CONDITION" << std::endl; - bc_out << "\t$PCS_TYPE" << std::endl << "\t\tGROUNDWATER_FLOW" << std::endl; - bc_out << "\t$PRIMARY_VARIABLE" << std::endl << "\t\tHEAD" << std::endl; - bc_out << "\t$GEO_TYPE" << std::endl << "\t\tPOINT PLYPNT" << argv[2] << - k << std::endl; - bc_out << "\t$DIS_TYPE" << std::endl << "\t\tCONSTANT " << - (*((*geo_pnts)[ply_pnt_ids[k]]))[2] << std::endl; + 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" << std::endl; - bc_out << "#STOP" << std::endl; + gli_out << "#STOP" << "\n"; + bc_out << "#STOP" << "\n"; gli_out.close (); bc_out.close (); } diff --git a/Utils/FileConverter/generateBCandGLI.cpp b/Utils/FileConverter/generateBCandGLI.cpp index cb48b597ee22dd30cbcc7e0cce2d4c637d91d18e..e7d946689d4037dfa9609685514d1a7953802196 100644 --- a/Utils/FileConverter/generateBCandGLI.cpp +++ b/Utils/FileConverter/generateBCandGLI.cpp @@ -101,24 +101,24 @@ int main (int argc, char* argv[]) // 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] << std::endl; + bc_out << "// file generated by " << argv[0] << "\n"; if (gli_out && bc_out) { - gli_out << "#POINTS" << std::endl; + gli_out << "#POINTS" << "\n"; for (size_t k(0); k < sfc_pnt_ids.size(); k++) { gli_out << k << " " << *((*geo_pnts)[sfc_pnt_ids[k]]) << " $NAME " << k << - std::endl; + "\n"; // boundary condition - bc_out << "#BOUNDARY_CONDITION" << std::endl; - bc_out << "\t$PCS_TYPE" << std::endl << "\t\tGROUNDWATER_FLOW" << std::endl; - bc_out << "\t$PRIMARY_VARIABLE" << std::endl << "\t\tHEAD" << std::endl; - bc_out << "\t$GEO_TYPE" << std::endl << "\t\tPOINT " << k << std::endl; - bc_out << "\t$DIS_TYPE" << std::endl << "\t\tCONSTANT " << - (*((*geo_pnts)[sfc_pnt_ids[k]]))[2] << std::endl; + 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 " << k << "\n"; + bc_out << "\t$DIS_TYPE" << "\n" << "\t\tCONSTANT " << + (*((*geo_pnts)[sfc_pnt_ids[k]]))[2] << "\n"; } - gli_out << "#STOP" << std::endl; - bc_out << "#STOP" << std::endl; + gli_out << "#STOP" << "\n"; + bc_out << "#STOP" << "\n"; gli_out.close (); bc_out.close (); } diff --git a/Utils/FileConverter/generateMatPropsFromMatID.cpp b/Utils/FileConverter/generateMatPropsFromMatID.cpp index 2c7b1611d714f1be993e00ea57490dfef40a476f..fe9d09c23a88690cd7b651d0217698521bda3d99 100644 --- a/Utils/FileConverter/generateMatPropsFromMatID.cpp +++ b/Utils/FileConverter/generateMatPropsFromMatID.cpp @@ -38,7 +38,7 @@ int main (int argc, char* argv[]) if (out_prop.is_open()) { for (size_t i=0; i<nElems; i++) - out_prop << i << "\t" << (*elems)[i]->material << std::endl; + out_prop << i << "\t" << (*elems)[i]->material << "\n"; out_prop.close(); } else diff --git a/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp b/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp index b98194c23755d31bd8753fcde8eb911b2b9ac552..32d372b31059079a4c254cf9881c088664b21acc 100644 --- a/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp +++ b/Utils/SimpleMeshCreation/createMeshElemPropertiesFromASCRaster.cpp @@ -163,7 +163,7 @@ int main (int argc, char* argv[]) } for (size_t k(0); k<n_dest_mesh_elements; k++) { - property_out << k << " " << dest_properties[k] << std::endl; + property_out << k << " " << dest_properties[k] << "\n"; } property_out.close(); }