46 const Real t = 0.0)
const {
47 return (*formula_)(p,t); }
49 const Real t = 0.0)
const {
50 return (*formula_)(p,t); }
51 virtual F
operator()(
const Connector& cell,
const Real3d& p,
52 const Real t = 0.0)
const {
53 return (*formula_)(p,t); }
55 virtual std::ostream&
info(std::ostream&
os)
const {
58 std::unique_ptr<Formula<F> > formula_;
83 template<
typename F = Real>
101 const Real t = 0.0)
const
102 {
return (*
this)[cell.
attrib()]; }
105 const Real t = 0.0)
const
106 {
return (*
this)[cell.
attrib()]; }
117 inline virtual F
operator()(
const Connector& cell,
const Real3d& p,
118 const Real t = 0.0)
const
119 {
return (*
this)[cell.attrib()]; }
120 virtual const F& operator[](
const uint attrib)
const;
131 virtual std::ostream&
info(std::ostream&
os)
const;
141 while(i != formula_.end())
165 template<
typename F = Real>
173 void read_(std::istringstream&
iss);
182 template<
typename F = Real>
190 const Real t = 0.0)
const
191 {
return (*formula_)[cell.
attrib()]; }
194 const Real t = 0.0)
const
195 {
return (*formula_)[cell.
attrib()]; }
198 const Real t = 0.0)
const
199 {
return (*formula_)[cell.
attrib()]; }
201 virtual std::ostream&
info(std::ostream&
os)
const;
225 const Real t = 0.0)
const;
227 const Real t = 0.0)
const;
229 const Real t = 0.0)
const;
236 void set(
const uint attrib,
const F a);
248 : formula_(
nullptr), factor_(frm.factor_) {
249 formula_.reset(frm.formula_.get());
251 std::unique_ptr<Formula<F> > formula_;
252 typename Datatype<F>::type factor_;
254 virtual std::ostream&
info(std::ostream&
os)
const {
return os;}
256 virtual std::ostream&
info(std::ostream&
os)
const;
265 while(i != formula_.end())
266 i++->second.factor_ *=
factor;
273 if (i != formula_.end())
274 i->second.factor_ *=
factor;
301 const Real t=0.0)
const
303 typename ElemFormulaMap::const_iterator
305 if (i != formulas_.end())
306 return i->second.operator()(elm, p, t);
312 const Real t=0.0)
const
314 typename ElemFormulaMap::const_iterator
316 if (i != formulas_.end())
317 return i->second.operator()(elm, p, t);
323 const Real t=0.0)
const
325 typename ElemFormulaMap::const_iterator
327 if (i != formulas_.end())
328 return i->second.operator()(elm, p, t);
337 formulas_[attrib] = formula;
351 virtual std::ostream&
info(std::ostream&
os)
const {
353 << formulas_ <<
")" << std::endl;
370 virtual F operator()(
const F val)
const = 0;
373 virtual std::ostream&
info(std::ostream&
os)
const;
383 virtual F operator()(
const F val)
const;
385 virtual std::ostream&
info(std::ostream&
os)
const;
397 virtual F operator()(
const F val)
const;
399 virtual std::ostream&
info(std::ostream&
os)
const;
409 virtual F operator()(
const F val)
const;
412 virtual std::ostream&
info(std::ostream&
os)
const;
424 template<
typename F,
typename G = F>
432 const Real t = 0.0)
const;
434 const Real t = 0.0)
const;
436 const Real t = 0.0)
const;
444 virtual std::ostream&
info(std::ostream&
os)
const;
449 std::vector<Operation<F>*> operations_;
460 template<
typename F,
typename G,
typename H = G,
471 const Real t = 0.0)
const;
473 const Real t = 0.0)
const;
475 const Real t = 0.0)
const;
477 virtual std::ostream&
info(std::ostream&
os)
const;
480 std::unique_ptr<const PiecewiseFormulaBase<G> > formula1_;
481 std::unique_ptr<const PiecewiseFormulaBase<H> > formula2_;
502 const Real t = 0.0)
const;
504 const Real t = 0.0)
const;
506 const Real t = 0.0)
const;
512 virtual std::ostream&
info(std::ostream&
os)
const;
virtual Connector & connector() const =0
Returns the connector.
const Attribute & attrib() const
Returns the attribute of the connector.
virtual const Cell & cell() const =0
Returns the cell on which the element is built.
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual OpAdd< F > * clone() const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual OpMult< F > * clone() const
virtual OpRecipr< F > * clone() const
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
virtual Operation< F > * clone() const =0
virtual std::ostream & info(std::ostream &os) const
Returns information in an output stream.
std::string typeOf(const T &t)
Set< F > makeSet(uint n, const F &first,...)