Skip to content
Snippets Groups Projects
Commit 48327361 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

begining of Gmsh file reader

parent c5e13607
Branches
Tags
No related merge requests found
...@@ -64,5 +64,6 @@ target_link_libraries( ...@@ -64,5 +64,6 @@ target_link_libraries(
pastis pastis
kokkos kokkos
PastisUtils PastisUtils
PastisMesh
PastisExperimental) PastisExperimental)
...@@ -12,7 +12,7 @@ include_directories(utils) ...@@ -12,7 +12,7 @@ include_directories(utils)
include_directories(algebra) include_directories(algebra)
# Pastis mesh # Pastis mesh
#add_subdirectory(mesh) add_subdirectory(mesh)
include_directories(mesh) include_directories(mesh)
# Pastis mesh # Pastis mesh
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
#include <TinyVector.hpp> #include <TinyVector.hpp>
#include <TinyMatrix.hpp> #include <TinyMatrix.hpp>
#include <GmshReader.hpp>
#include <CLI/CLI.hpp> #include <CLI/CLI.hpp>
#include <cassert> #include <cassert>
#include <limits> #include <limits>
...@@ -27,12 +29,14 @@ ...@@ -27,12 +29,14 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
long unsigned number = 10; long unsigned number = 10;
std::string filename;
{ {
CLI::App app{"Pastis help"}; CLI::App app{"Pastis help"};
app.add_option("number,-n,--number", number, "Number of cells");//->required(); app.add_option("number,-n,--number", number, "Number of cells");//->required();
app.add_option("filename,-f,--filename", filename, "gmsh file");//->required();
int threads=-1; int threads=-1;
app.add_option("--threads", threads, "Number of Kokkos threads")->check(CLI::Range(1,std::numeric_limits<decltype(threads)>::max())); app.add_option("--threads", threads, "Number of Kokkos threads")->check(CLI::Range(1,std::numeric_limits<decltype(threads)>::max()));
...@@ -116,7 +120,11 @@ int main(int argc, char *argv[]) ...@@ -116,7 +120,11 @@ int main(int argc, char *argv[])
// } // }
{ // class for acoustic solver test if (filename != "") {
std::cout << "Reading (gmsh) " << rang::style::underline << filename << rang::style::reset << " ...\n";
GmshReader gmsh_reader(filename);
} else {
// class for acoustic solver test
Kokkos::Timer timer; Kokkos::Timer timer;
timer.reset(); timer.reset();
Connectivity1D connectivity(number); Connectivity1D connectivity(number);
......
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# ------------------- Source files --------------------
add_library(
PastisMesh
GmshReader.cpp)
#include_directories(${PASTIS_SOURCE_DIR}/utils)
# Additional dependencies
#add_dependencies(PastisMesh)
#include <GmshReader.hpp>
#include <iostream>
#include <fstream>
GmshReader::GmshReader(const std::string& filename)
{
std::ifstream fin(filename);
if (not fin) {
std::cerr << "cannot read file '" << filename << "'\n";
std::exit(0);
}
}
#ifndef GMSH_READER_HPP
#define GMSH_READER_HPP
#include <string>
class GmshReader
{
public:
GmshReader(const std::string& filename);
~GmshReader() = default;
};
#endif // GMSH_READER_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment