13#include <tclap/CmdLine.h> 
   38int main(
int argc, 
char* argv[])
 
   41        "Generates properties for mesh elements of an input mesh deploying a " 
   42        "ASC raster file.\n\n" 
   43        "OpenGeoSys-6 software, version " +
 
   46            "Copyright (c) 2012-2025, OpenGeoSys Community " 
   47            "(http://www.opengeosys.org)",
 
   50    TCLAP::ValueArg<std::string> out_mesh_arg(
 
   53        "Output (.vtu). The output mesh is stored to a file of this name",
 
   57    cmd.add(out_mesh_arg);
 
   59    TCLAP::SwitchArg refinement_raster_output_arg(
 
   60        "", 
"output-refined-raster",
 
   61        "Write refined raster to an additional, new ASC file.");
 
   62    cmd.add(refinement_raster_output_arg);
 
   64    TCLAP::ValueArg<unsigned> refinement_arg(
 
   67        "refinement factor that raises the resolution of the raster data",
 
   71    cmd.add(refinement_arg);
 
   73    TCLAP::ValueArg<std::string> raster_arg(
 
   76        "Input (.asc). The name of the input " 
   83    TCLAP::ValueArg<std::string> property_arg(
 
   86        "the name of the property the values are stored for",
 
   90    cmd.add(property_arg);
 
   92    TCLAP::ValueArg<std::string> mesh_arg(
 
   93        "m", 
"mesh", 
"Input (.vtu). The input mesh is read from this file",
 
   94        true, 
"", 
"INPUT_FILE");
 
   98    cmd.add(log_level_arg);
 
   99    cmd.parse(argc, argv);
 
  105    std::unique_ptr<MeshLib::Mesh> dest_mesh(
 
  109    auto raster = std::unique_ptr<GeoLib::Raster>(
 
  111            raster_arg.getValue()));
 
  113    if (refinement_arg.getValue() > 1)
 
  115        raster->refineRaster(refinement_arg.getValue());
 
  116        if (refinement_raster_output_arg.getValue())
 
  119            std::string new_raster_fname(
 
  121            new_raster_fname += 
"-" + std::to_string(header.
n_rows) + 
"x" +
 
  122                                std::to_string(header.
n_cols) + 
".asc";
 
  128    std::unique_ptr<MeshLib::Mesh> src_mesh(
 
  132                                            property_arg.getValue()));
 
  136        *src_mesh, property_arg.getValue());
 
  139    if (!out_mesh_arg.getValue().empty())
 
 
Definition of the AsciiRasterInterface class.
Definition of the Element class.
Implementation of the Mesh2MeshPropertyInterpolation class.
Definition of mesh-related Enumerations.
Definition of the Mesh class.
Definition of the GeoLib::Raster class.
Definition of the VtkMeshConverter class.
static void writeRasterAsASC(GeoLib::Raster const &raster, std::string const &file_name)
Writes an Esri asc-file.
static GeoLib::Raster * getRasterFromASCFile(std::string const &fname)
Reads an ArcGis ASC raster file.
int main(int argc, char *argv[])
TCLAP::ValueArg< std::string > makeLogLevelArg()
void initOGSLogger(std::string const &log_level)
std::string dropFileExtension(std::string const &filename)
GITINFOLIB_EXPORT const std::string ogs_version
MeshLib::Mesh * readMeshFromFile(const std::string &file_name, bool const compute_element_neighbors)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)
Definition of the quicksort function.
Definition of readMeshFromFile function.