an efficient C++ finite element environment
|
|
Go to the documentation of this file. 1 #include "rheolef/adapt.h"
22 #include "rheolef/form.h"
23 #include "rheolef/field_component.h"
24 #include "rheolef/rheostream.h"
25 #include "rheolef/field_expr.h"
30 template<
class T,
class M>
33 const field_basic<T,M>& uh0,
34 const adapt_option& opts);
36 template<
class T,
class M>
38 proj (
const field_basic<T,M>& uh,
const std::string& approx =
"P1");
47 if (!bamg_in)
return string();
48 check_macro (
dis_scatch(bamg_in,
"Geometry"),
"mark \"Geometry\" not founded in bamg file");
52 for (
size_t i = 0; i < arg.length(); ++i) {
53 if (arg[i] !=
'"')
out << arg[i];
55 string file_bamgcad =
out.str();
61 template<
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;
118 idiststream bamg_in (bamg_name);
120 if (bamgcad_file.length() == 0) bamgcad_file = omega.familyname() +
".bamgcad";
121 check_macro (
dis_file_exists(bamgcad_file),
"adapt: missing \""<<bamgcad_file<<
"\" file");
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";
161 check_macro (
dis_file_exists(dmn_name),
"adapt: missing \""<<dmn_name<<
"\" file");
162 command =
"cat " + i1_name +
".bamg " + dmn_name
163 +
" | bamg2geo -" + omega.coordinate_system_name()
164 +
" | gzip -9 > " + i1_name +
".geo.gz";
170 idiststream in (i1_name,
"geo");
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;
189 #define _RHEOLEF_instanciation(T,M) \
190 template geo_basic<T,M> adapt_bamg (const field_basic<T,M>&, const adapt_option&);
193 #ifdef _RHEOLEF_HAVE_MPI
195 #endif // _RHEOLEF_HAVE_MPI
generic mesh with rerefence counting
const space_type & get_space() const
geo_basic< T, M > adapt_bamg(const field_basic< T, M > &uh, const adapt_option &opts)
_RHEOLEF_instanciation(Float, sequential, std::allocator< Float >) _RHEOLEF_instanciation(Float
adapt_option: see the adapt page for the full documentation
string delete_any_suffix(const string &name)
delete_any_suffix: see the rheostream page for the full documentation
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
#define _RHEOLEF_RHEOLEF_LIBDIR
std::string bamgcad_catch_name(idiststream &bamg_in)
const geo_type & get_geo() const
bool dis_file_exists(const std::string &filename, const communicator &comm)
size_type n_smooth_metric
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
field_basic< T, M > proj(const field_basic< T, M > &uh, const std::string &approx="P1")
string ftos(const Float &x)
itof: see the rheostream page for the full documentation
field::size_type size_type
std::string itos(std::string::size_type i)
itos: see the rheostream page for the full documentation
bool dis_scatch(idiststream &ips, const communicator &comm, std::string ch)
distributed version of scatch(istream&,string)
field_basic< T, M > hessian_criterion(const field_basic< T, M > &uh0, const adapt_option &opts)