~ubuntu-branches/ubuntu/wily/rheolef/wily

« back to all changes in this revision

Viewing changes to nfem/plib/field_vf_expr_ops_make.cc

  • Committer: Package Import Robot
  • Author(s): Pierre Saramito
  • Date: 2013-09-16 17:11:03 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20130916171103-3osrjwzjx20bstow
Tags: 6.5-1
* New upstream release 6.5 (major changes):
   - new discontinuous Galerkin FEM methods
   - source code compile now with g++-4.8 and boost-1.54 (closes: #701347)
     thanks to Matthias Klose <doko@debian.org>
   - minor bug fixes (closes: #716110, #715672, #716547)
     thanks to Alexandre Rebert <alexandre@cmu.edu>
   - minor changes for automake-1.14
* control:
  - add break and replaces rules (closes: #709155)
    thanks to a patch from Andreas Beckmann <anbe@debian.org>
  - fix lintian warning "vcs-fields-not-canonical" (closes: #714185)
    thanks to Sebastian Ramacher <sramacher@debian.org>
  - remove texi2html from "build-depends" (was a lintian error)
* rules: add "make distclean" to the rules/clean target (closes: #714204)
  thanks to explanations from Sebastian Ramacher <sramacher@debian.org>

Show diffs side-by-side

added added

removed removed

Lines of Context:
165
165
  s op_t     = (i == 1) ? raw_op_t : details+"::swapper<" + raw_op_t + ">";
166
166
  s op_t_var = (i == 1) ? "raw_op_t" : details+"::swapper<raw_op_t>";
167
167
  s op       = (i == 1) ? "op_t()" : "op_t(raw_op_t())";
 
168
  s arg_x = make_const_arg(arg1,"x");
 
169
  s arg_y = make_const_arg(arg2,"y");
168
170
  cout << "inline" << endl
169
171
       << root << "_vf_expr<" << endl
170
172
       << "  " << root << "_vf_expr_binded_bf<" << endl
173
175
       << "   ," << w_tst << endl
174
176
       << "  >" << endl
175
177
       << ">" << endl
176
 
       << add_operator(o.name) << " (const " << arg1 << "& x, const " << arg2 << "& y)" << endl
 
178
       << add_operator(o.name) << " (" << arg_x << ", " << arg_y << ")" << endl
177
179
       << "{" << endl
178
180
       << "  typedef " << raw_op_t << "                         raw_op_t;" << endl
179
181
       << "  typedef " << op_t_var << "                         op_t;" << endl
247
249
      // and skip type errors as v/tensor or dot(v,tensor):
248
250
      if (!o.have_arg (i, t)) continue;
249
251
      // -----------------------------
250
 
      // field_functor, Result=Float,point,tensor
 
252
      // field_functor
251
253
      // -----------------------------
252
254
      cout << "template<class T, class M, class Fun, class VfTag>" << endl;
253
255
      vf_multop_by_field_bind (o, details, i,
261
263
        "field_expr_terminal_function<Fun>",
262
264
        "field_vf_expr<Expr,VfTag>"); 
263
265
 
264
 
      // ----------------------------------------
265
 
      // function or class-function, Result=Float
266
 
      // ----------------------------------------
267
 
      // TODO: ajouter ici la classe fct si l'arg est unique (genre dot ou ddot)
268
 
      // et sinon ajouter les vraies fonctions: pbs d'ecriture du typage dans le profil ?
 
266
      // -----------------------------
 
267
      // true function
 
268
      // -----------------------------
 
269
      cout << "template<class T, class M, class VfTag>" << endl;
 
270
      vf_multop_by_field_bind (o, details, i,
 
271
        valued(t,"T")+"(&)(const point_basic<T>&)",
 
272
        "field_expr_terminal_function<"+valued(t,"T")+"(const point_basic<T>&)>",
 
273
        "test_basic<T,M,VfTag>");
 
274
 
 
275
      cout << "template<class Expr, class VfTag>" << endl;
 
276
      vf_multop_by_field_bind (o, details, i,
 
277
        valued(t,"typename Expr::scalar_type")+"(&)(const point_basic<typename Expr::scalar_type>&)",
 
278
        "field_expr_terminal_function<"+valued(t,"typename Expr::scalar_type")+"(const point_basic<typename Expr::scalar_type>&)>",
 
279
        "field_vf_expr<Expr,VfTag>"); 
 
280
      // ----------------------------------------
 
281
      // class-function, when Result=unique
 
282
      // ----------------------------------------
 
283
      // function<R(Arg)> are not distinguished by the return type => skip ambiguities
 
284
      // by fixing Result
269
285
      bool arg_is_unique = (o.arg(i) == v::s || o.arg(i) == v::p || o.arg(i) == v::t);
270
286
      bool use_class_fct = (t == v::s) || arg_is_unique;
271
287
      if (!use_class_fct) continue;