Skip to content

Commit 3a1b770

Browse files
committed
output_triangulation: added output_eps_as_2D case to output the top view xy-plane of a 3D mesh
1 parent 83704c4 commit 3a1b770

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

numEx-helper_fnc.h

+15-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ namespace enums
7474
enum enum_output_type
7575
{
7676
output_eps = 0,
77-
output_inp = 1
77+
output_inp = 1,
78+
output_eps_as_2D = 2
7879
};
7980

8081
enum enum_notch_type
@@ -222,7 +223,8 @@ namespace numEx
222223
}
223224

224225
template<int dim>
225-
void output_triangulation ( const Triangulation<dim> &triangulation, const unsigned int output_type=enums::output_eps, const std::string numEx_name="numEx", const bool terminate_after_output=false )
226+
void output_triangulation ( const Triangulation<dim> &triangulation, const unsigned int output_type=enums::output_eps,
227+
const std::string numEx_name="numEx", const bool terminate_after_output=false )
226228
{
227229
std::cout << "numEx<< Writting triangulation to output ..." << std::endl;
228230
std::ostringstream filename;
@@ -246,6 +248,17 @@ namespace numEx
246248
grid_out.write_ucd(triangulation, out_ucd);
247249
break;
248250
}
251+
case enums::output_eps_as_2D:
252+
{
253+
// Output top view (xy-plane) of 3D mesh
254+
filename << "grid-" << numEx_name << ".eps";
255+
std::ofstream out (filename.str().c_str()); // @todo-optimize That should be simpler?!
256+
GridOut grid_out;
257+
GridOutFlags::Eps<dim> eps_flags(GridOutFlags::EpsFlagsBase::SizeType::width,300,0.5,false,2,1e-6/*0 fails*/,0);
258+
grid_out.set_flags(eps_flags);
259+
grid_out.write_eps (triangulation, out);
260+
break;
261+
}
249262
default:
250263
AssertThrow(false, ExcMessage(numEx_name+" - output_triangulation<< You choose a not implemented output type, try eps or inp instead."));
251264
}

0 commit comments

Comments
 (0)