From: Wolfgang Bangerth Date: Mon, 13 Jul 2009 12:45:33 +0000 (+0000) Subject: Convert arrays that contain logical integers to integer arrays. X-Git-Tag: v8.0.0~7491 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d067ccb16a306caa17351936575a991dede71383;p=dealii.git Convert arrays that contain logical integers to integer arrays. git-svn-id: https://svn.dealii.org/trunk@19068 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/mesh_conversion/MeshConversion.cc b/deal.II/contrib/mesh_conversion/MeshConversion.cc index 3c7f3c2a8a..bb71ce779f 100755 --- a/deal.II/contrib/mesh_conversion/MeshConversion.cc +++ b/deal.II/contrib/mesh_conversion/MeshConversion.cc @@ -1,5 +1,8 @@ #include "MeshConversion.h" +#include + + //-------------------------------------------------------------------------------- MeshConversion::MeshConversion (const unsigned int dimension): @@ -171,14 +174,14 @@ bool MeshConversion::read_in_abaqus_inp (const std::string filename) (from_string (temp_float, temp_data[k + 3 + j*(data_per_cell)], std::dec) == true)) { // Initilise storage variables - std::vector cell (data_per_cell); + std::vector cell (data_per_cell); // Material id cell[0] = material_id; // Convert from string to the variable types for (int i = 1; i < data_per_cell; ++i) - from_string (cell[i], temp_data[k + 3 + j*(data_per_cell) + i], std::dec); + from_string (cell[i], temp_data[k + 3 + j*(data_per_cell) + i], std::dec); // Add to the global node number vector cell_list.push_back(cell); @@ -229,8 +232,8 @@ bool MeshConversion::read_in_abaqus_inp (const std::string filename) face_cell_face_no += (face_cell_face_no_temp[face_cell_face_no_temp.length() - m - 1] - 48 /* ASCII TRICKS */) * pow(10.0,m); // Initilise storage variables - std::vector quad (data_per_quad); - std::vector quad_node_list (node_per_face); + std::vector quad (data_per_quad); + std::vector quad_node_list (node_per_face); quad_node_list = get_global_node_numbers(face_cell_no, face_cell_face_no); @@ -259,9 +262,9 @@ bool MeshConversion::read_in_abaqus_inp (const std::string filename) //-------------------------------------------------------------------------------- -std::vector MeshConversion::get_global_node_numbers (const int face_cell_no, const int face_cell_face_no) +std::vector MeshConversion::get_global_node_numbers (const int face_cell_no, const int face_cell_face_no) { - std::vector quad_node_list (node_per_face); + std::vector quad_node_list (node_per_face); if (dimension == 2) { @@ -409,7 +412,7 @@ bool MeshConversion::write_out_avs_ucd (const std::string filename) // Write out cell node numbers for (unsigned int ii = 0; ii < cell_list.size(); ++ii) { - output << ii + 1 << "\t" << cell_list[ii][0] << "\t" << (dimension==2 ? "quad" : "hex") << "\t"; + output << ii + 1 << "\t" << cell_list[ii][0] << "\t" << (dimension==2 ? "quad" : "hex") << "\t"; for (unsigned int jj = 1; jj < node_per_cell + 1; ++jj) output << cell_list[ii][jj] << "\t"; @@ -419,7 +422,7 @@ bool MeshConversion::write_out_avs_ucd (const std::string filename) // Write out quad node numbers for (unsigned int ii = 0; ii < face_list.size(); ++ii) { - output << ii + 1 << "\t" << face_list[ii][0] << "\t" << (dimension==2 ? "line" : "quad") << "\t"; + output << ii + 1 << "\t" << (int)face_list[ii][0] << "\t" << (dimension==2 ? "line" : "quad") << "\t"; for (unsigned int jj = 1; jj < node_per_face + 1; ++jj) output << face_list[ii][jj] << "\t"; diff --git a/deal.II/contrib/mesh_conversion/MeshConversion.h b/deal.II/contrib/mesh_conversion/MeshConversion.h index c44a384da7..b5c681cf0b 100755 --- a/deal.II/contrib/mesh_conversion/MeshConversion.h +++ b/deal.II/contrib/mesh_conversion/MeshConversion.h @@ -23,7 +23,7 @@ class MeshConversion private: void greeting (); - std::vector get_global_node_numbers(const int face_cell_no, const int face_cell_face_no); + std::vector get_global_node_numbers(const int face_cell_no, const int face_cell_face_no); const double tolerance; const unsigned int dimension; @@ -36,8 +36,8 @@ class MeshConversion std::string output_file_name; std::vector< std::vector > node_list; // Stored as [ global node-id (int), x-coord, y-coord, z-coord ] - std::vector< std::vector > cell_list; // Stored as [ material-id (int), node1, node2, node3, node4, node5, node6, node7, node8 ] - std::vector< std::vector > face_list; // Stored as [ sideset-id (int), node1, node2, node3, node4 ] + std::vector< std::vector > cell_list; // Stored as [ material-id (int), node1, node2, node3, node4, node5, node6, node7, node8 ] + std::vector< std::vector > face_list; // Stored as [ sideset-id (int), node1, node2, node3, node4 ] }; #endif // MESH_CONVERSION_H