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(
pastis
kokkos
PastisUtils
PastisMesh
PastisExperimental)
......@@ -12,7 +12,7 @@ include_directories(utils)
include_directories(algebra)
# Pastis mesh
#add_subdirectory(mesh)
add_subdirectory(mesh)
include_directories(mesh)
# Pastis mesh
......
......@@ -19,6 +19,8 @@
#include <TinyVector.hpp>
#include <TinyMatrix.hpp>
#include <GmshReader.hpp>
#include <CLI/CLI.hpp>
#include <cassert>
#include <limits>
......@@ -27,12 +29,14 @@
int main(int argc, char *argv[])
{
long unsigned number = 10;
std::string filename;
{
CLI::App app{"Pastis help"};
app.add_option("number,-n,--number", number, "Number of cells");//->required();
app.add_option("filename,-f,--filename", filename, "gmsh file");//->required();
int threads=-1;
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[])
// }
{ // 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;
timer.reset();
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