68 |
} |
} |
69 |
|
|
70 |
//! operator() : evaluate a UserFunction at position \a X. |
//! operator() : evaluate a UserFunction at position \a X. |
71 |
virtual const real_t operator()(const TinyVector<3>& X) const |
virtual real_t operator()(const TinyVector<3>& X) const |
72 |
{ |
{ |
73 |
return f(X[0],X[1],X[2]); |
return f(X[0],X[1],X[2]); |
74 |
} |
} |
108 |
ReferenceCounting<UserFunction> __u; |
ReferenceCounting<UserFunction> __u; |
109 |
|
|
110 |
public: |
public: |
111 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
112 |
{ |
{ |
113 |
return (-(*__u)(X)); |
return (-(*__u)(X)); |
114 |
} |
} |
152 |
void gradient(TinyVector<3>& gradient, |
void gradient(TinyVector<3>& gradient, |
153 |
const TinyVector<3>& X) const; |
const TinyVector<3>& X) const; |
154 |
|
|
155 |
const real_t operator()(const TinyVector<3>& X) const; |
real_t operator()(const TinyVector<3>& X) const; |
156 |
|
|
157 |
UserFunctionLanguage(UserFunctionLanguage& U); |
UserFunctionLanguage(UserFunctionLanguage& U); |
158 |
|
|
172 |
{ |
{ |
173 |
private: |
private: |
174 |
//! The constant value. |
//! The constant value. |
175 |
real_t d; |
const real_t d; |
176 |
public: |
public: |
177 |
|
|
178 |
//! operator() : evaluate a ConstUserFunction at position \a X. |
//! operator() : evaluate a ConstUserFunction at position \a X. |
179 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
180 |
{ |
{ |
181 |
return d; |
return d; |
182 |
} |
} |
213 |
public: |
public: |
214 |
|
|
215 |
//! operator(): Evaluate the function sum at position \a X. |
//! operator(): Evaluate the function sum at position \a X. |
216 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
217 |
{ |
{ |
218 |
return (*F)(X) + (*G)(X); |
return (*F)(X) + (*G)(X); |
219 |
} |
} |
252 |
public: |
public: |
253 |
|
|
254 |
//! operator(): Evaluate the difference of \a F and \a G at position \a X. |
//! operator(): Evaluate the difference of \a F and \a G at position \a X. |
255 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
256 |
{ |
{ |
257 |
return (*F)(X)-(*G)(X); |
return (*F)(X)-(*G)(X); |
258 |
} |
} |
291 |
public: |
public: |
292 |
|
|
293 |
//! Evaluation of \a F \a G at \a X. |
//! Evaluation of \a F \a G at \a X. |
294 |
const real_t operator()(const TinyVector<3>& X) const { |
real_t operator()(const TinyVector<3>& X) const { |
295 |
return (*F)(X) * (*G)(X); |
return (*F)(X) * (*G)(X); |
296 |
} |
} |
297 |
|
|
329 |
public: |
public: |
330 |
|
|
331 |
//! Evaluation of \f$ \frac{F}{G} \f$ at \a X. |
//! Evaluation of \f$ \frac{F}{G} \f$ at \a X. |
332 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
333 |
{ |
{ |
334 |
return (*F)(X)/(*G)(X); |
return (*F)(X)/(*G)(X); |
335 |
} |
} |
369 |
public: |
public: |
370 |
|
|
371 |
//! Evaluates \f$ F\circ G \f$ at \a X. |
//! Evaluates \f$ F\circ G \f$ at \a X. |
372 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
373 |
{ |
{ |
374 |
return (*F)((*G)(X)); |
return (*F)((*G)(X)); |
375 |
} |
} |
412 |
public: |
public: |
413 |
|
|
414 |
//! Evaluation of \f$ F^G \f$ at point \a X. |
//! Evaluation of \f$ F^G \f$ at point \a X. |
415 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
416 |
{ |
{ |
417 |
return std::pow((*F)(X),(*G)(X)); |
return std::pow((*F)(X),(*G)(X)); |
418 |
} |
} |
458 |
public: |
public: |
459 |
|
|
460 |
//! Evaluates \f$ 1_{f>g} \f$ at point \a X. |
//! Evaluates \f$ 1_{f>g} \f$ at point \a X. |
461 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
462 |
{ |
{ |
463 |
return (real_t)((*f)(X)>(*g)(X)); |
return (real_t)((*f)(X)>(*g)(X)); |
464 |
} |
} |
498 |
public: |
public: |
499 |
|
|
500 |
//! Evaluates \f$ 1_{f\geq g} \f$ at point \a X. |
//! Evaluates \f$ 1_{f\geq g} \f$ at point \a X. |
501 |
const real_t operator()(const TinyVector<3>& X) const |
real_t operator()(const TinyVector<3>& X) const |
502 |
{ |
{ |
503 |
return (real_t)((*f)(X)>=(*g)(X)); |
return (real_t)((*f)(X)>=(*g)(X)); |
504 |
} |
} |
537 |
public: |
public: |
538 |
|
|
539 |
//! Evaluates \f$ 1_{f < g} \f$ at point \a X. |
//! Evaluates \f$ 1_{f < g} \f$ at point \a X. |
540 |
const real_t operator()(const TinyVector<3>& X) const { |
real_t operator()(const TinyVector<3>& X) const { |
541 |
return (real_t)((*f)(X)<(*g)(X)); |
return (real_t)((*f)(X)<(*g)(X)); |
542 |
} |
} |
543 |
|
|
575 |
|
|
576 |
public: |
public: |
577 |
//! Evaluates \f$ 1_{f \leq g} \f$ at point \a X. |
//! Evaluates \f$ 1_{f \leq g} \f$ at point \a X. |
578 |
const real_t operator() (const TinyVector<3>& X) const |
real_t operator() (const TinyVector<3>& X) const |
579 |
{ |
{ |
580 |
return (real_t)((*f)(X)<=(*g)(X)); |
return (real_t)((*f)(X)<=(*g)(X)); |
581 |
} |
} |
611 |
public: |
public: |
612 |
|
|
613 |
//! Evaluates \f$ 1_{f = g} \f$ at point \a X. |
//! Evaluates \f$ 1_{f = g} \f$ at point \a X. |
614 |
const real_t operator() (const TinyVector<3>& X) const |
real_t operator() (const TinyVector<3>& X) const |
615 |
{ |
{ |
616 |
return (real_t)(std::abs((*f)(X)-(*g)(X))<1E-6); |
return (real_t)(std::abs((*f)(X)-(*g)(X))<1E-6); |
617 |
} |
} |
650 |
|
|
651 |
public: |
public: |
652 |
//! Evaluates \f$ 1_{f \neq g} \f$ at point \a X. |
//! Evaluates \f$ 1_{f \neq g} \f$ at point \a X. |
653 |
const real_t operator() (const TinyVector<3>& X) const |
real_t operator() (const TinyVector<3>& X) const |
654 |
{ |
{ |
655 |
return (real_t)(std::abs((*f)(X)-(*g)(X))>=1E-6); |
return (real_t)(std::abs((*f)(X)-(*g)(X))>=1E-6); |
656 |
} |
} |
689 |
public: |
public: |
690 |
|
|
691 |
//! Evaluates \f$ \{x, f(x)=1\} \cap \{x, g(x)=1\} \f$ at point \a X. |
//! Evaluates \f$ \{x, f(x)=1\} \cap \{x, g(x)=1\} \f$ at point \a X. |
692 |
const real_t operator() (const TinyVector<3>& X) const |
real_t operator() (const TinyVector<3>& X) const |
693 |
{ |
{ |
694 |
return (*f)(X)*(*g)(X); |
return (*f)(X)*(*g)(X); |
695 |
} |
} |
729 |
public: |
public: |
730 |
|
|
731 |
//! Evaluates \f$ {x, f(x)=1} \cup \{x, g(x)=1\} \f$ at point \a X. |
//! Evaluates \f$ {x, f(x)=1} \cup \{x, g(x)=1\} \f$ at point \a X. |
732 |
const real_t operator() (const TinyVector<3>& X) const |
real_t operator() (const TinyVector<3>& X) const |
733 |
{ |
{ |
734 |
const real_t fxyz = (*f)(X); |
const real_t fxyz = (*f)(X); |
735 |
const real_t gxyz = (*g)(X); |
const real_t gxyz = (*g)(X); |
767 |
public: |
public: |
768 |
|
|
769 |
//! Evaluates the FEMUserFunction at point \a X. |
//! Evaluates the FEMUserFunction at point \a X. |
770 |
const real_t operator()(const TinyVector<3>& V) const; |
real_t operator()(const TinyVector<3>& V) const; |
771 |
|
|
772 |
//! Access to the value at the ith vertex of the mesh \a M. |
//! Access to the value at the ith vertex of the mesh \a M. |
773 |
inline real_t& operator[](const size_t& i) |
inline real_t& operator[](const size_t& i) |
828 |
public: |
public: |
829 |
|
|
830 |
//! Evalutes \f$ 1_{\cup_i o_i} \f$ at point \a X. |
//! Evalutes \f$ 1_{\cup_i o_i} \f$ at point \a X. |
831 |
const real_t operator()(const TinyVector<3>& X) const; |
real_t operator()(const TinyVector<3>& X) const; |
832 |
|
|
833 |
//! Constructs a OneUserFunction using the POV-Ray reference \a r. |
//! Constructs a OneUserFunction using the POV-Ray reference \a r. |
834 |
OneUserFunction(TinyVector<3>& r); |
OneUserFunction(TinyVector<3>& r); |
855 |
public: |
public: |
856 |
|
|
857 |
//! Evalutes the characteristic function of the \a mesh at point \a X |
//! Evalutes the characteristic function of the \a mesh at point \a X |
858 |
const real_t operator()(const TinyVector<3>& X) const; |
real_t operator()(const TinyVector<3>& X) const; |
859 |
|
|
860 |
//! Constructs a OneMeshUserFunction using a \a Mesh. |
//! Constructs a OneMeshUserFunction using a \a Mesh. |
861 |
OneMeshUserFunction(ConstReferenceCounting<Structured3DMesh> Mesh); |
OneMeshUserFunction(ConstReferenceCounting<Structured3DMesh> Mesh); |