21#include "rheolef/adapt.h"
22#include "rheolef/form.h"
23#include "rheolef/field_wdof_sliced.h"
24#include "rheolef/rheostream.h"
25#include "rheolef/field_expr.h"
30template<
class T,
class M>
33 const field_basic<T,M>& uh0,
34 const adapt_option& opts);
36template<
class T,
class M>
38proj (
const field_basic<T,M>& uh,
const std::string& approx =
"P1");
47 if (!bamg_in)
return string();
52 for (
size_t i = 0; i < arg.length(); ++i) {
53 if (arg[i] !=
'"') out << arg[i];
55 string file_bamgcad = out.str();
61template<
class T,
class M>
69 bool do_verbose = iorheo::getverbose(clog);
70 bool do_clean = iorheo::getclean(clog);
78 string i_name = omega.name();
79 string geo_name = i_name +
".geo";
85 check_macro (out.good(),
"adapt: file \"" << geo_name <<
"\"creation failed");
87 clean_files +=
" " + geo_name +
" " + geo_name +
".gz";
92 string bamg_name = i_name +
".bamg";
94 clean_files +=
" " + bamg_name;
99 string crit_name = i_name +
"-crit.field";
100 clean_files +=
" " + crit_name +
".gz";
101 out.open (crit_name,
"field");
103 check_macro (out.good(),
"adapt: file \"" << crit_name <<
"\"creation failed");
108 string bb_name = i_name +
"-crit.bb";
109 clean_files +=
" " + bb_name;
111 command =
"zcat < " + crit_name +
".gz | " + bindir +
"/field2bb > " + bb_name;
112 if (do_verbose) derr <<
"! " << command << endl;
120 if (bamgcad_file.length() == 0) bamgcad_file = omega.familyname() +
".bamgcad";
123 if (! uh.
get_space().get_basis().is_continuous()) k++;
127 error =
pow (error, 2./(k+1));
131 +
" -err " +
ftos(error)
141 options +=
" -splitpbedge ";
143 if (opts.
thetaquad != numeric_limits<Float>::max()) {
148 sprintf (buffer,
"%.3d",
int(i+1));
149 string i1_name = omega.familyname() +
"-" + buffer;
154 +
" -o " + i1_name +
".bamg 1>&2";
155 if (do_verbose) derr <<
"! " << command << endl;
162 command =
"cat " + i1_name +
".bamg " + dmn_name
163 +
" | bamg2geo -" + omega.coordinate_system_name()
164 +
" | gzip -9 > " + i1_name +
".geo.gz";
165 if (do_verbose) derr <<
"! " << command << endl;
173 new_omega.set_name (omega.familyname());
174 new_omega.set_serial_number (i+1);
175 clean_files +=
" " + i1_name +
".geo.gz";
180 command =
"rm -f" + clean_files;
181 if (do_verbose) derr <<
"! " << command << endl;
189#define _RHEOLEF_instanciation(T,M) \
190template geo_basic<T,M> adapt_bamg (const field_basic<T,M>&, const adapt_option&);
193#ifdef _RHEOLEF_HAVE_MPI
#define _RHEOLEF_instanciation(T, M, A)
field::size_type size_type
see the Float page for the full documentation
const geo_type & get_geo() const
const space_type & get_space() const
generic mesh with rerefence counting
idiststream: see the diststream page for the full documentation
odiststream: see the diststream page for the full documentation
#define _RHEOLEF_RHEOLEF_LIBDIR
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
This file is part of Rheolef.
field_basic< T, M > hessian_criterion(const field_basic< T, M > &uh0, const adapt_option &opts)
bool dis_scatch(idiststream &ips, const communicator &comm, std::string ch)
distributed version of scatch(istream&,string)
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
field_basic< T, M > proj(const field_basic< T, M > &uh, const std::string &approx="P1")
int dis_system(const std::string &command, const communicator &comm)
bool dis_file_exists(const std::string &filename, const communicator &comm)
string delete_any_suffix(const string &name)
delete_any_suffix: see the rheostream page for the full documentation
geo_basic< T, M > adapt_bamg(const field_basic< T, M > &uh, const adapt_option &opts)
string ftos(const Float &x)
itof: see the rheostream page for the full documentation
std::string bamgcad_catch_name(idiststream &bamg_in)
adapt_option: see the adapt page for the full documentation
size_type n_smooth_metric