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

Begining of Gmesh reading of 1d meshes

parent b9c0fad4
No related branches found
No related tags found
No related merge requests found
......@@ -856,24 +856,30 @@ GmshReader::__proceedData()
xr[i][0] = __vertices[i][0];
xr[i][1] = __vertices[i][1];
}
m_mesh = new MeshType(std::shared_ptr<Connectivity2D>(p_connectivity),
xr);
MeshType& mesh = *m_mesh;
m_mesh = new MeshType(std::shared_ptr<Connectivity2D>(p_connectivity), xr);
std::ofstream gnuplot("mesh.gnu");
} else if ((dimension1_mask, elementNumber)>0) {
const size_t nb_cells = (dimension1_mask, elementNumber);
const size_t max_nb_node_per_cell=2;
for (size_t j=0; j<mesh.numberOfCells(); ++j) {
for (int r=0; r<mesh.connectivity().cellNbNodes()[j]; ++r) {
const Rd& x = mesh.xr()[mesh.connectivity().cellNodes()(j,r)];
gnuplot << x[0] << ' ' << x[1] << '\n';
const Kokkos::View<unsigned int*[2]> cell_nodes("cell_nodes", nb_cells, max_nb_node_per_cell);
for (size_t j=0; j<nb_cells; ++j) {
cell_nodes(j,0) = __edges[j][0];
cell_nodes(j,1) = __edges[j][1];
}
const Rd& x = mesh.xr()[mesh.connectivity().cellNodes()(j,0)];
gnuplot << x[0] << ' ' << x[1] << "\n\n";
const Kokkos::View<unsigned short*> cell_nb_nodes("cell_nb_nodes", nb_cells);
for (size_t j=0; j<nb_cells; ++j) {
cell_nb_nodes[j] = 2;
}
gnuplot.close();
} else if ((dimension1_mask, elementNumber)>0) {
std::cerr << "*** using a 1d mesh (NIY)\n";
// std::shared_ptr<Connectivity1D> connectivity(new Connectivity1D());
// m_connectivity = new Connectivity2D(cell_nb_nodes, cell_nodes);
// Connectivity2D& connectivity = *m_connectivity;
std::cerr << "*** using a 1d mesh (Implementation in progress)\n";
std::exit(0);
} else {
std::cerr << "*** using a dimension 0 mesh is forbidden!\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment