an efficient C++ finite element environment
|
|
Go to the documentation of this file.
35 int main(
int argc,
char**argv) {
37 size_t subdivide = (argc > 1) ? atoi(argv[1]) : 3;
38 Float field_error = (argc > 2) ? atof(argv[2]) : 1e-3;
39 Float geo_error = 1e-7;
40 bool do_verbose =
true;
44 check_macro (communicator().size() == 1,
"zalesak_dg_adapt: command may be used as mono-process only");
51 din >> ievent (t0, phi0_h);
52 while (
din >> ievent (tf, phi_h));
57 << oevent (t0, ch, phi0_h, phi_h);
58 cleanlist +=
tmp+
"criterion-0.vtk";
62 string py_name =
tmp+
"adapt.py";
64 cleanlist +=
" "+py_name;
65 bool view_2d = phi_h.
get_geo().map_dimension() < 3;
66 py <<
"#!/usr/bin/env pvbatch --script=" << endl
67 <<
"# This is a paraview script automatically generated by rheolef." << endl
69 <<
"from paraview.simple import *" << endl
70 <<
"from paraview_rheolef import * # load rheolef specific functions" << endl
72 <<
"opt = { \\" << endl
73 <<
" 'mark' : 'c', \\" << endl
74 <<
" 'view_2d' : " << view_2d <<
", \\" << endl
75 <<
" 'geo_error' : " << geo_error <<
", \\" << endl
76 <<
" 'field_error' : " << field_error <<
", \\" << endl
77 <<
" 'subdivide' : " << subdivide <<
" \\" << endl
80 <<
"adapt_Pk_iso_P1 (paraview, \""<<
tmp<<
"criterion-0.vtk\", \""<<
tmp<<
"adapt.vtk\", opt)" << endl
83 string prog =
"pvbatch --force-offscreen-rendering ";
87 cleanlist +=
" "+
tmp+
"adapt.vtk";
93 idiststream in_vtk (
tmp+
"adapt.vtk");
95 iorheo::setbasename(in_vtk.is(),
"adapt");
97 in_vtk >> ia_event (t, c_ha, phi0_ha, phi_ha);
99 branch oa_event (
"t",
"phi");
101 << oa_event (t0, phi0_ha)
102 << oa_event (tf, phi_ha);
107 command =
"rm -f " + cleanlist;
112 cerr <<
"zalesak_dg_adapt: mesh size " << Xh.get_geo().size()
113 <<
" -> " << phi_ha.
get_geo().size() << endl;
const space_type & get_space() const
details::field_expr_v2_nonlinear_node_nary< typename details::function_traits< Function >::functor_type,typename details::field_expr_v2_nonlinear_terminal_wrapper_traits< Exprs >::type... > ::type compose(const Function &f, const Exprs &... exprs)
see the compose page for the full documentation
std::string get_tmpdir()
get_tmpdir: see the rheostream page for the full documentation
int main(int argc, char **argv)
see the space page for the full documentation
Float criterion(const Float &x, const Float &y)
const geo_type & get_geo() const
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format format vtk
field_basic< T, M > interpolate(const space_basic< T, M > &V2h, const field_basic< T, M > &u1h)
see the interpolate page for the full documentation
idiststream din
see the diststream page for the full documentation
see the environment page for the full documentation
This file is part of Rheolef.
int dis_system(const std::string &command, const communicator &comm)
odiststream derr(cerr)
see the diststream page for the full documentation
odiststream: see the diststream page for the full documentation
see the Float page for the full documentation
see the branch page for the full documentation
Float heaviside(const Float &x)
#define _RHEOLEF_PKGDATADIR
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color rheo
odiststream dout(cout)
see the diststream page for the full documentation
The Zalesak slotted disk benchmark – the exact solution.