Commit e9616d10 authored by Stenger, Florian's avatar Stenger, Florian
Browse files

meshconv v3.13

parent 374ef6eb
Software License for meshconv
Copyright (c) 2008-2018 Technische Universität Dresden
Copyright (c) 2008-2019 Technische Universität Dresden
All rights reserved.
Author: Florian Stenger
......
// Copyright (c) 2008-2018 Technische Universität Dresden
// Copyright (c) 2008-2019 Technische Universität Dresden
// All rights reserved.
// Author: Florian Stenger
// This file is part of meshconv. See also license.txt in the distribution-folder.
......@@ -8,7 +8,7 @@
using namespace std;
using namespace meshconv;
//----------------------------------------< main >
//--------------------< main >
int main(int argc, char* argv[]){
srand(time(NULL));
string cmdline = "";
......
No preview for this file type
// Copyright (c) 2008-2018 Technische Universität Dresden
// Copyright (c) 2008-2019 Technische Universität Dresden
// All rights reserved.
// Author: Florian Stenger
// This file is part of meshconv. See also license.txt in the distribution-folder.
......@@ -15,14 +15,14 @@ using namespace std;
// ## BackGrid - General ##
// ##########################
//----------------------------------------< static members for configuration >
//--------------------< static members for configuration >
int BackGrid::segmentation_degree = -1; //-1 means automatic switching dependent on mesh-size
double BackGrid::search_distance = -1.0;
#if DEBUG_COUNT_AMBIGUOUS_RAYS != 0
unsigned long BackGrid::ambiguous_ray_count = 0;
#endif
//----------------------------------------< debug_output_dimensions >
//--------------------< debug_output_dimensions >
void BackGrid::debug_output_dimensions(){
int x, y, z, sum=0, cnt=0;
......@@ -39,7 +39,7 @@ void BackGrid::debug_output_dimensions(){
cout << "average entries: " << double(sum) / cnt << endl;
}
//----------------------------------------< init >
//--------------------< init >
//the optional mesh 'n' is only used to extend coordinate-extrema 'minc' and 'maxc'
void BackGrid::init(Mesh *m, Mesh *n, uchar operation_index_mode, bool no_scaling){
int x, y;
......@@ -203,7 +203,7 @@ void BackGrid::init(Mesh *m, Mesh *n, uchar operation_index_mode, bool no_scalin
}
}
//----------------------------------------< attach_mesh >
//--------------------< attach_mesh >
void BackGrid::attach_mesh(Mesh *n){
this->n = n;
if(n->dim_of_world == 2){
......@@ -213,7 +213,7 @@ void BackGrid::attach_mesh(Mesh *n){
}
}
//----------------------------------------< init_lamps >
//--------------------< init_lamps >
void BackGrid::init_lamps(short dim_of_world){
int i;
Vertex dist;
......@@ -223,38 +223,38 @@ void BackGrid::init_lamps(short dim_of_world){
lamp_count = 20;
lamps.resize(lamp_count);
for(i = 0; i < lamp_count; i += 2){
lamps[i][0] = minc[0] - dist[0] / 2 - RAND * dist[0];
lamps[i][1] = minc[1] + RAND * dist[1];
lamps[i+1][0] = maxc[0] + dist[0] / 2 + RAND * dist[0];
lamps[i+1][1] = minc[1] + RAND * dist[1];
lamps[i][0] = minc[0] - dist[0] / 2 - drnd(0.0, dist[0]);
lamps[i][1] = minc[1] + drnd(0.0, dist[1]);
lamps[i + 1][0] = maxc[0] + dist[0] / 2 + drnd(0.0, dist[0]);
lamps[i + 1][1] = minc[1] + drnd(0.0, dist[1]);
}
}else if(dim_of_world == 3){
lamp_count = 60;
lamps.resize(lamp_count);
for(i = 0; i < lamp_count; i += 6){
lamps[i+0][0] = maxc[0] + dist[0] / 2.0 + RAND * dist[0];
lamps[i+0][1] = minc[1] + RAND * dist[1];
lamps[i+0][2] = minc[2] + RAND * dist[2];
lamps[i+1][0] = minc[0] - dist[0] / 2.0 - RAND * dist[0];
lamps[i+1][1] = minc[1] + RAND * dist[1];
lamps[i+1][2] = minc[2] + RAND * dist[2];
lamps[i+2][0] = minc[0] + RAND * dist[0];
lamps[i+2][1] = maxc[1] + dist[1] / 2.0 + RAND * dist[1];
lamps[i+2][2] = minc[2] + RAND * dist[2];
lamps[i+3][0] = minc[0] + RAND * dist[0];
lamps[i+3][1] = minc[1] - dist[1] / 2.0 - RAND * dist[1];
lamps[i+3][2] = minc[2] + RAND * dist[2];
lamps[i+4][0] = minc[0] + RAND * dist[0];
lamps[i+4][1] = minc[1] + RAND * dist[1];
lamps[i+4][2] = maxc[2] + dist[2] / 2.0 + RAND * dist[2];
lamps[i+5][0] = minc[0] + RAND * dist[0];
lamps[i+5][1] = minc[1] + RAND * dist[1];
lamps[i+5][2] = minc[2] - dist[2] / 2.0 - RAND * dist[2];
lamps[i][0] = maxc[0] + dist[0] / 2.0 + drnd(0.0, dist[0]);
lamps[i][1] = minc[1] + drnd(0.0, dist[1]);
lamps[i + 0][2] = minc[2] + drnd(0.0, dist[2]);
lamps[i + 1][0] = minc[0] - dist[0] / 2.0 - drnd(0.0, dist[0]);
lamps[i + 1][1] = minc[1] + drnd(0.0, dist[1]);
lamps[i + 1][2] = minc[2] + drnd(0.0, dist[2]);
lamps[i + 2][0] = minc[0] + drnd(0.0, dist[0]);
lamps[i + 2][1] = maxc[1] + dist[1] / 2.0 + drnd(0.0, dist[1]);
lamps[i + 2][2] = minc[2] + drnd(0.0, dist[2]);
lamps[i + 3][0] = minc[0] + drnd(0.0, dist[0]);
lamps[i + 3][1] = minc[1] - dist[1] / 2.0 - drnd(0.0, dist[1]);
lamps[i + 3][2] = minc[2] + drnd(0.0, dist[2]);
lamps[i + 4][0] = minc[0] + drnd(0.0, dist[0]);
lamps[i + 4][1] = minc[1] + drnd(0.0, dist[1]);
lamps[i + 4][2] = maxc[2] + dist[2] / 2.0 + drnd(0.0, dist[2]);
lamps[i + 5][0] = minc[0] + drnd(0.0, dist[0]);
lamps[i + 5][1] = minc[1] + drnd(0.0, dist[1]);
lamps[i + 5][2] = minc[2] - dist[2] / 2.0 - drnd(0.0, dist[2]);
}
}
}
//----------------------------------------< clear >
//--------------------< clear >
void BackGrid::clear(){
if(n != NULL && operation_index_mode == oim_create){
for(list<Element>::iterator it=n->elements.begin(); it!=n->elements.end(); ++it){
......@@ -271,7 +271,7 @@ void BackGrid::clear(){
// ## BackGrid - 2D Worlds ##
// ############################
//----------------------------------------< attach_mesh_2d >
//--------------------< attach_mesh_2d >
void BackGrid::attach_mesh_2d(){
list<Element>::iterator it;
int x, y, cnt=0;
......@@ -366,7 +366,7 @@ void BackGrid::attach_mesh_2d(){
}
}
//----------------------------------------< get_segments_for_element_2d >
//--------------------< get_segments_for_element_2d >
//element 'e' should be a a line-segment in a 2D-world.
void BackGrid::get_segments_for_element_2d(Mesh *m, Element &e, vector<vector<int> > &seg_vec){
int x, y;
......@@ -420,7 +420,7 @@ void BackGrid::get_segments_for_element_2d(Mesh *m, Element &e, vector<vector<in
}
}
//----------------------------------------< intersection_with_element_2d >
//--------------------< intersection_with_element_2d >
//returns true if a vertex of the attached mesh lies inside element 'e'.
bool BackGrid::intersection_with_element_2d(Mesh *m, Element &e){
int sx1, sy1, sx2, sy2;
......@@ -476,7 +476,7 @@ bool BackGrid::intersection_with_element_2d(Mesh *m, Element &e){
return false;
}
//----------------------------------------< count_intersections_with_ray_2d >
//--------------------< count_intersections_with_ray_2d >
int BackGrid::count_intersections_with_ray_2d(const Vertex &destination){
int hit_vertex, lamp_index, lamp_x, cnt=0;
int new_x, ix, iy, sx1, sx2, sy1, sy2;
......@@ -617,7 +617,7 @@ int BackGrid::count_intersections_with_ray_2d(const Vertex &destination){
return cnt;
}
//----------------------------------------< test_distances_2d >
//--------------------< test_distances_2d >
//tests whether one of the surface elements in the segment with indices 'ix', 'iy' has a distance to
//'destination' which is smaller than 'min_distance'. If so, 'min_distance' is set to the new smallest
//distance.
......@@ -640,7 +640,7 @@ void BackGrid::test_distances_2d(const Vertex &destination, int ix, int iy, int
}
}
//----------------------------------------< distance_to_surface_2d >
//--------------------< distance_to_surface_2d >
double BackGrid::distance_to_surface_2d(const Vertex &destination, int &element_index){
int i;
int ix, iy, sx1, sx2, sy1, sy2, p1, p2;
......@@ -703,7 +703,7 @@ double BackGrid::distance_to_surface_2d(const Vertex &destination, int &element_
return min_distance;
}
//----------------------------------------< vertices_in_sphere_2d >
//--------------------< vertices_in_sphere_2d >
void BackGrid::vertices_in_sphere_2d(int center_vertex, double radius,
multimap<double, VertexConnectivity> &vertices){
int x, y, i, a, t;
......@@ -852,7 +852,7 @@ void BackGrid::vertices_in_sphere_2d(int center_vertex, double radius,
// ## BackGrid - 3D Worlds ##
// ############################
//----------------------------------------< attach_mesh_3d >
//--------------------< attach_mesh_3d >
void BackGrid::attach_mesh_3d(){
list<Element>::iterator it;
int x, y, z, i, j;
......@@ -1130,7 +1130,7 @@ void BackGrid::attach_mesh_3d(){
}
}
//----------------------------------------< get_segments_for_element_3d >
//--------------------< get_segments_for_element_3d >
//element 'e' should be a a triangle in a 3D-world.
void BackGrid::get_segments_for_element_3d(Mesh *m, Element &e, vector<vector<int> > &seg_vec){
list<Element>::iterator it;
......@@ -1365,7 +1365,7 @@ void BackGrid::get_segments_for_element_3d(Mesh *m, Element &e, vector<vector<in
}
}
//----------------------------------------< intersection_with_element_3d >
//--------------------< intersection_with_element_3d >
//returns true if a vertex of the attached mesh lies inside element 'e'.
bool BackGrid::intersection_with_element_3d(Mesh *m, Element &e){
int sx1, sy1, sz1, sx2, sy2, sz2;
......@@ -1431,7 +1431,7 @@ bool BackGrid::intersection_with_element_3d(Mesh *m, Element &e){
return false;
}
//----------------------------------------< intersection_with_ray_bd_3d >
//--------------------< intersection_with_ray_bd_3d >
//Does not use Element::operation_index but Element::bd->operation_index!
bool BackGrid::intersection_with_ray_bd_3d(const Vertex &destination, const Vertex &lamp){
int intersection_result;
......@@ -1573,7 +1573,7 @@ bool BackGrid::intersection_with_ray_bd_3d(const Vertex &destination, const Vert
return false;
}
//----------------------------------------< count_intersections_with_ray_3d >
//--------------------< count_intersections_with_ray_3d >
int BackGrid::count_intersections_with_ray_3d(const Vertex &destination){
int lamp_index = -1, cnt = 0;
int intersection_result;
......@@ -1800,7 +1800,7 @@ int BackGrid::count_intersections_with_ray_3d(const Vertex &destination){
return cnt;
}
//----------------------------------------< test_distances_3d >
//--------------------< test_distances_3d >
//tests whether one of the surface elements in the segment with indices 'ix', 'iy', 'iz' has a
//distance to 'destination' which is smaller than 'min_distance'. If so, 'min_distance' is set
//to the new smallest distance.
......@@ -1825,7 +1825,7 @@ void BackGrid::test_distances_3d(const Vertex &destination, int ix, int iy, int
}
}
//----------------------------------------< distance_to_surface_3d >
//--------------------< distance_to_surface_3d >
double BackGrid::distance_to_surface_3d(const Vertex &destination, int &element_index){
int i, x, y, z;
int sx1, sx2, sy1, sy2, sz1, sz2;
......@@ -1992,7 +1992,7 @@ double BackGrid::distance_to_surface_3d(const Vertex &destination, int &element_
return min_distance;
}
//----------------------------------------< vertices_in_sphere_3d >
//--------------------< vertices_in_sphere_3d >
//returns a list of vertices lying completely inside a sphere of the specified radius around the
//specified center_vertex.
void BackGrid::vertices_in_sphere_3d(int center_vertex, double radius,
......@@ -2161,11 +2161,11 @@ void BackGrid::vertices_in_sphere_3d(int center_vertex, double radius,
// ## BackGridPointCloud - General ##
// ####################################
//----------------------------------------< static members for configuration >
//--------------------< static members for configuration >
int BackGridPointCloud::segmentation_degree = -1; //-1 means automatic switching dependent on mesh-size
double BackGridPointCloud::search_distance = -1.0;
//----------------------------------------< init >
//--------------------< init >
//the optional mesh 'n' is only used to extend coordinate-extrema 'minc' and 'maxc'
void BackGridPointCloud::init(Mesh *m, Mesh *n, bool no_scaling){
int x, y;
......@@ -2270,7 +2270,7 @@ void BackGridPointCloud::init(Mesh *m, Mesh *n, bool no_scaling){
}
}
//----------------------------------------< attach_mesh >
//--------------------< attach_mesh >
void BackGridPointCloud::attach_mesh(Mesh *n){
vector<Vertex>::iterator it;
int c[3] = {0, 0, 0};
......@@ -2285,7 +2285,7 @@ void BackGridPointCloud::attach_mesh(Mesh *n){
}
}
//----------------------------------------< closest_point >
//--------------------< closest_point >
double BackGridPointCloud::closest_point(const Vertex &destination, int &point_index){
if(n->dim_of_world == 2){
return closest_point_2d(destination, point_index);
......@@ -2299,7 +2299,7 @@ double BackGridPointCloud::closest_point(const Vertex &destination, int &point_i
// ## BackGridPointCloud - 2D Worlds ##
// ######################################
//----------------------------------------< test_distances_2d >
//--------------------< test_distances_2d >
//tests whether one of the points in the segment with indices 'ix', 'iy', 'iz' has a distance to
//'destination' which is smaller than 'min_distance'. If so, 'min_distance' is set to the new
//smallest distance.
......@@ -2318,7 +2318,7 @@ void BackGridPointCloud::test_distances_2d(const Vertex &destination, int ix, in
}
}
//----------------------------------------< closest_point_2d >
//--------------------< closest_point_2d >
double BackGridPointCloud::closest_point_2d(const Vertex &destination, int &point_index){
int i;
int ix, iy, sx1, sx2, sy1, sy2, p1, p2;
......@@ -2376,7 +2376,7 @@ double BackGridPointCloud::closest_point_2d(const Vertex &destination, int &poin
// ## BackGridPointCloud - 3D Worlds ##
// ######################################
//----------------------------------------< test_distances_3d >
//--------------------< test_distances_3d >
//tests whether one of the points in the segment with indices 'ix', 'iy', 'iz' has a distance to
//'destination' which is smaller than 'min_distance'. If so, 'min_distance' is set to the new
//smallest distance.
......@@ -2395,7 +2395,7 @@ void BackGridPointCloud::test_distances_3d(const Vertex &destination, int ix, in
}
}
//----------------------------------------< closest_point_3d >
//--------------------< closest_point_3d >
double BackGridPointCloud::closest_point_3d(const Vertex &destination, int &point_index){
int i, x, y, z;
int sx1, sx2, sy1, sy2, sz1, sz2;
......
// Copyright (c) 2008-2018 Technische Universität Dresden
// Copyright (c) 2008-2019 Technische Universität Dresden
// All rights reserved.
// Author: Florian Stenger
// This file is part of meshconv. See also license.txt in the distribution-folder.
......@@ -12,7 +12,7 @@ using namespace std;
// ## Boundary Operations ##
// ###########################
//----------------------------------------< nullify_boundary >
//--------------------< nullify_boundary >
//sets all boundary-indices to zero
void nullify_boundary(Mesh &m){
for(list<Element>::iterator it = m.elements.begin(), end = m.elements.end(); it != end; ++it){
......@@ -21,7 +21,7 @@ void nullify_boundary(Mesh &m){
m.boundary_checked = false;
}
//----------------------------------------< determine_boundary >
//--------------------< determine_boundary >
//triangles or tetrahedra
void determine_boundary(Mesh &m){
void (*sorting_function)(int *input, int *output);
......@@ -63,7 +63,7 @@ void determine_boundary(Mesh &m){
m.boundary_checked = true;
}
//----------------------------------------< determine_neighbourhood_only >
//--------------------< determine_neighbourhood_only >
//triangles or tetrahedra
void determine_neighbourhood_only(Mesh &m){
void (*sorting_function)(int *input, int *output);
......@@ -104,7 +104,7 @@ void determine_neighbourhood_only(Mesh &m){
m.boundary_checked = true;
}
//----------------------------------------< box_boundary >
//--------------------< box_boundary >
void box_boundary(Mesh &m, int x0, int x1, int y0, int y1, int z0, int z1){
int i, e, f;
Vertex max_value, min_value;
......@@ -185,7 +185,7 @@ void box_boundary(Mesh &m, int x0, int x1, int y0, int y1, int z0, int z1){
m.boundary_checked = true;
}
//----------------------------------------< box_boundary_periodic >
//--------------------< box_boundary_periodic >
//only works for dim_of_world = dim_of_elements = 2 or dim_of_world = dim_of_elements = 3
//or dim_of_world = 3, dim_of_elements = 2.
vector<vector<vector<int> > >* box_boundary_periodic(Mesh &m, int *dimensions){
......@@ -266,42 +266,39 @@ vector<vector<vector<int> > >* box_boundary_periodic(Mesh &m, int *dimensions){
return result;
}
//----------------------------------------< selection_boundary_2d >
//--------------------< selection_boundary_2d >
void selection_boundary_2d(Mesh &m, Mesh &n, int boundary_index){
vector<vector<int> > segments;
list<Element>::iterator it;
AugmentedList<Element*>::iterator seg_it;
AugmentedList<Element*>* segment;
Element* el;
BackGrid back;
bool element_found;
unsigned int i, face, a;
Element face_el;
if(!m.boundary_checked) determine_boundary(m);
back.init(&m);
back.attach_mesh(&n);
for(it = m.elements.begin(); it != m.elements.end(); ++it){
for(face = 0; face < 3; ++face){
for(list<Element>::iterator it = m.elements.begin(),
it_end = m.elements.end(); it != it_end; ++it){
for(unsigned face = 0; face < 3; ++face){
if(it->b[face] < 0){
a = 0;
for(i = 0; i < 2; ++i){
unsigned a = 0;
for(unsigned i = 0; i < 2; ++i){
if(i == face) ++a;
face_el.v[i] = it->v[a++];
}
back.get_segments_for_element_2d(&m, face_el, segments);
for(i=0; i<segments.size(); ++i){
for(unsigned i = 0, seg_size = segments.size(); i < seg_size; ++i){
segment = &back.grid[segments[i][0]][segments[i][1]][0];
for(seg_it=segment->begin(); seg_it!=segment->end(); ++seg_it){
el = *seg_it;
element_found = false;
if(points_identical_2d(n.vertices[el->v[0]], m.vertices[face_el.v[0]])){
if(points_identical_2d(n.vertices[el->v[1]], m.vertices[face_el.v[1]])){
for(AugmentedList<Element*>::iterator seg_it = segment->begin(),
seg_end = segment->end(); seg_it != seg_end; ++seg_it){
Element &el = **seg_it;
bool element_found = false;
if(points_identical_2d(n.vertices[el.v[0]], m.vertices[face_el.v[0]])){
if(points_identical_2d(n.vertices[el.v[1]], m.vertices[face_el.v[1]])){
element_found = true;
}
}else if(points_identical_2d(n.vertices[el->v[0]], m.vertices[face_el.v[1]])){
if(points_identical_2d(n.vertices[el->v[1]], m.vertices[face_el.v[0]])){
}else if(points_identical_2d(n.vertices[el.v[0]], m.vertices[face_el.v[1]])){
if(points_identical_2d(n.vertices[el.v[1]], m.vertices[face_el.v[0]])){
element_found = true;
}
}
......@@ -315,7 +312,7 @@ void selection_boundary_2d(Mesh &m, Mesh &n, int boundary_index){
}
}
//----------------------------------------< selection_boundary_3d >
//--------------------< selection_boundary_3d >
void selection_boundary_3d(Mesh &m, Mesh &n, int boundary_index){
vector<vector<int> > segments;
list<Element>::iterator it;
......
This diff is collapsed.
// Copyright (c) 2008-2018 Technische Universität Dresden
// Copyright (c) 2008-2019 Technische Universität Dresden
// All rights reserved.
// Author: Florian Stenger
// This file is part of meshconv. See also license.txt in the distribution-folder.
......@@ -16,7 +16,7 @@
namespace meshconv{
using namespace std;
//----------------------------------------< decompress_buffer >
//--------------------< decompress_buffer >
//Use this routine if the size of the uncompressed data 'osize' is known. Decompresses buffer 'ibuf'
//of size 'isize' into an already allocated buffer 'obuf' of size 'osize'.
void decompress_buffer(const char *ibuf, const unsigned isize, char *obuf, const unsigned osize,
......@@ -33,7 +33,7 @@ void decompress_buffer(const char *ibuf, const unsigned isize, char *obuf, const
boost::iostreams::copy(fin, sink);
}
//----------------------------------------< decompress_buffer >
//--------------------< decompress_buffer >
//Use this routine if the size of the uncompressed data is not known. Decompresses buffer 'ibuf'
//of size 'isize' into buffer 'obuf' which will be allocated by this function and has to be deleted
//by the caller. Returns the number of bytes allocated.
......@@ -55,7 +55,7 @@ unsigned decompress_buffer(const char *ibuf, const unsigned isize, char *&obuf,
return size;
}
//----------------------------------------< write_compressed_buffer >
//--------------------< write_compressed_buffer >
//Compresses buffer 'buf' of size 'bsize' and writes the result to the output-stream 'out'.
//Returns the number of bytes written (i.e. the size of the compressed data and not 'bsize').
unsigned write_compressed_buffer(ofstream &out, const char *buf, const unsigned bsize,
......@@ -74,7 +74,7 @@ unsigned write_compressed_buffer(ofstream &out, const char *buf, const unsigned
return out.tellp() - pos;
}
//----------------------------------------< read_compressed_buffer >
//--------------------< read_compressed_buffer >
//Use this routine if the size of the uncompressed data 'bsize' is known. Reads 'fsize' bytes from
//'in' and decompresses them into the already allocated buffer 'buf' of size 'bsize'.
void read_compressed_buffer(ifstream &in, char *buf, const unsigned bsize, const unsigned fsize,
......@@ -85,7 +85,7 @@ void read_compressed_buffer(ifstream &in, char *buf, const unsigned bsize, const
delete [] ibuf;
}
//----------------------------------------< read_compressed_buffer >
//--------------------< read_compressed_buffer >
//Use this routine if the size of the uncompressed data is not known. Reads 'fsize' bytes from
//'in' and decompresses them into buffer 'buf' which will be allocated by this function and has
//to be deleted by the caller. Returns the number of bytes allocated.
......@@ -98,7 +98,7 @@ unsigned read_compressed_buffer(ifstream &in, char *&buf, const unsigned fsize,
return result;
}
//----------------------------------------< write_compressed_string >
//--------------------< write_compressed_string >
//zlib-compresses the contents of 'str' and writes it to 'out'. This should be the last data
//written to the output-file, otherwise the reader will not know where to stop.
void write_compressed_string(ofstream &out, const string &str, const int compression_type){
......@@ -113,7 +113,7 @@ void write_compressed_string(ofstream &out, const string &str, const int compres
boost::iostreams::copy(fout, out);
}
//----------------------------------------< read_compressed_string >
//--------------------< read_compressed_string >
//Reads the rest of 'in' (from the current position onwards) and zlib-decompresses it into 'str'.
void read_compressed_string(ifstream &in, string &str, const int compression_type){
stringstream decompressed;
......
<
// Copyright (c) 2008-2018 Technische Universitt Dresden
// Copyright (c) 2008-2019 Technische Universitt Dresden
// All rights reserved.
// Author: Florian Stenger
// This file is part of meshconv. See also license.txt in the distribution-folder.
......@@ -14,7 +14,7 @@ using namespace std;
// ## File-Readers ##
// ####################
//----------------------------------------< get_mesh_dimensions_from_binary >
//--------------------< get_mesh_dimensions_from_binary >
void get_mesh_dimensions_from_binary(string file, short &dim_of_world, short &dim_of_elements){
const unsigned is = sizeof(int);
const unsigned ss = sizeof(short);
......@@ -29,7 +29,7 @@ void get_mesh_dimensions_from_binary(string file, short &dim_of_world, short &di
in.close();
}
//----------------------------------------< get_mesh_info_from_binary >
//--------------------< get_mesh_info_from_binary >
void get_mesh_info_from_binary(string file, int &numvertices, int &numelements){
const unsigned is = sizeof(int);
......@@ -42,7 +42,7 @@ void get_mesh_info_from_binary(string file, int &numvertices, int &numelements){
in.close();
}
//----------------------------------------< get_vector_info_from_binary >
//--------------------< get_vector_info_from_binary >
void get_vector_info_from_binary(string file, int &numvertices){
ifstream in(file.c_str(), ios_base::in | ios_base::binary);
if(!in) error("Could not read file \"" + file + "\".");
......@@ -53,7 +53,7 @@ void get_vector_info_from_binary(string file, int &numvertices){
in.close();
}
//----------------------------------------< read_meshconv_file >
//--------------------< read_meshconv_file >
void read_meshconv_file(string file, Mesh *m, const vector<DataVector*> &vecs){
const unsigned ds = sizeof(double);
const unsigned is = sizeof(int);
......@@ -178,7 +178,7 @@ void read_meshconv_file(string file, Mesh *m, const vector<DataVector*> &vecs){
in.close();
}
//----------------------------------------< read_counts_from_vtu_file >
//--------------------< read_counts_from_vtu_file >
//only reads the number of vertices and elements from the file
void read_counts_from_vtu_file(string file, int &vertex_count, int &element_count){
string buf;
......@@ -216,7 +216,7 @@ void read_counts_from_vtu_file(string file, int &vertex_count, int &element_coun
error("Do not understand line \"" + buf + "\".");
}
//----------------------------------------< VtuValueReader >
//--------------------< VtuValueReader >
struct VtuValueReader{
int64_t total_size, block_cnt, block_size, last_block_size, block_index, byte_position;
ifstream *in;
......@@ -296,7 +296,7 @@ struct VtuValueReader{
}
};
//----------------------------------------< VtuValueDecompressor >
//--------------------< VtuValueDecompressor >
struct VtuValueDecompressor : public VtuValueReader{
vector<int64_t> block_sizes_compressed;
......@@ -359,7 +359,7 @@ struct VtuValueDecompressor : public VtuValueReader{
}
};
//----------------------------------------< read_vtu_file >
//--------------------< read_vtu_file >
//triangular meshes in 2d- and 3d-worlds and tetrahedral meshes in 3d worlds supported at the moment
void read_vtu_file(string file, Mesh &m, vector<DataVector*> &vecs,
vector<DataVector*> &element_vecs, int &dim_of_world, bool read_mesh, bool add_mesh,
......@@ -918,7 +918,7 @@ void read_vtu_file(string file, Mesh &m, vector<DataVector*> &vecs,
in.close();
}
//----------------------------------------< read_pvtu_file >
//--------------------< read_pvtu_file >
void read_pvtu_file(string file, string mp, vector<string> &vps, bool unload, int &dim_of_world,
bool read_mesh){
string buf;
......@@ -1070,7 +1070,7 @@ void read_pvtu_file(string file, string mp, vector<string> &vps, bool unload, in
for(unsigned e = 0; e < vps.size(); ++e) add_vector_partitioning(vps[e], vecs[e]);
}
//----------------------------------------< read_amdis_file (from file) >
//--------------------< read_amdis_file (from file) >
//triangular meshes in 2d- or 3d-worlds and tetrahedral meshes in 3d worlds supported at the moment.
void read_amdis_file(string file, Mesh &m, bool add_mesh, uint64_t byte_offset){
//open input file
......@@ -1082,7 +1082,7 @@ void read_amdis_file(string file, Mesh &m, bool add_mesh, uint64_t byte_offset){
in.close();
}
//----------------------------------------< read_amdis_file (from ifstream) >
//--------------------< read_amdis_file (from ifstream) >
//triangular meshes in 2d- or 3d-worlds and tetrahedral meshes in 3d worlds supported at the moment.
void read_amdis_file(ifstream &in, Mesh &m, bool add_mesh, uint64_t byte_offset){
string buf;
......@@ -1209,7 +1209,7 @@ void read_amdis_file(ifstream &in, Mesh &m, bool add_mesh, uint64_t byte_offset)
if(missing_boundaries) nullify_boundary(m);