319 |
} |
} |
320 |
}; |
}; |
321 |
|
|
322 |
|
class FunctionExpressionDx |
323 |
|
: public FunctionExpression |
324 |
|
{ |
325 |
|
public: |
326 |
|
enum Direction { |
327 |
|
x, |
328 |
|
y, |
329 |
|
z |
330 |
|
}; |
331 |
|
|
332 |
|
private: |
333 |
|
//! xi |
334 |
|
FunctionExpressionDx::Direction __direction; |
335 |
|
|
336 |
|
//! The function to derive |
337 |
|
ReferenceCounting<FunctionExpression> __function; |
338 |
|
|
339 |
|
std::ostream& put(std::ostream& os) |
340 |
|
{ |
341 |
|
switch (__direction) { |
342 |
|
case (x): { |
343 |
|
os << "dx("; |
344 |
|
break; |
345 |
|
} |
346 |
|
case (y): { |
347 |
|
os << "dy("; |
348 |
|
break; |
349 |
|
} |
350 |
|
case (z): { |
351 |
|
os << "dz("; |
352 |
|
break; |
353 |
|
} |
354 |
|
} |
355 |
|
os << *__function << ')'; |
356 |
|
return os; |
357 |
|
} |
358 |
|
|
359 |
|
public: |
360 |
|
ReferenceCounting<FunctionExpression> value(); |
361 |
|
|
362 |
|
const real_t value(const real_t x, |
363 |
|
const real_t y, |
364 |
|
const real_t z); |
365 |
|
|
366 |
|
void execute(); |
367 |
|
|
368 |
|
FunctionExpressionDx(ReferenceCounting<FunctionExpression> function, |
369 |
|
FunctionExpressionDx::Direction d); |
370 |
|
|
371 |
|
FunctionExpressionDx(const FunctionExpressionDx& r); |
372 |
|
|
373 |
|
~FunctionExpressionDx(); |
374 |
|
}; |
375 |
|
|
376 |
#include <Vector.hpp> |
#include <Vector.hpp> |
377 |
|
|
378 |
class FunctionExpressionFEM |
class FunctionExpressionFEM |
396 |
const real_t y, |
const real_t y, |
397 |
const real_t z); |
const real_t z); |
398 |
|
|
399 |
|
template <typename MeshType> |
400 |
|
const real_t __dx(const double& x, |
401 |
|
const double& y, |
402 |
|
const double& z, |
403 |
|
const FunctionExpressionDx::Direction& d) const; |
404 |
|
|
405 |
public: |
public: |
406 |
const Vector<real_t>& vector() const |
const Vector<real_t>& vector() const |
407 |
{ |
{ |
426 |
const real_t y, |
const real_t y, |
427 |
const real_t z); |
const real_t z); |
428 |
|
|
429 |
|
const real_t dx(const double& x, |
430 |
|
const double& y, |
431 |
|
const double& z, |
432 |
|
const FunctionExpressionDx::Direction& d) const; |
433 |
|
|
434 |
const real_t dx(const TinyVector<3>& X, |
const real_t dx(const TinyVector<3>& X, |
435 |
const size_t i) const; |
const FunctionExpressionDx::Direction& d) const |
436 |
|
{ |
437 |
|
return dx(X[0], X[1], X[2], d); |
438 |
|
} |
439 |
|
|
440 |
void execute(); |
void execute(); |
441 |
|
|
442 |
FunctionExpressionFEM(ReferenceCounting<MeshExpression> mesh, |
FunctionExpressionFEM(ReferenceCounting<MeshExpression> mesh, |
443 |
ReferenceCounting<FunctionExpression> r); |
ReferenceCounting<FunctionExpression> r); |
444 |
|
|
445 |
FunctionExpressionFEM(ReferenceCounting<MeshExpression> mesh); |
FunctionExpressionFEM(ReferenceCounting<MeshExpression> mesh); |
446 |
|
|
449 |
~FunctionExpressionFEM(); |
~FunctionExpressionFEM(); |
450 |
}; |
}; |
451 |
|
|
|
class FunctionExpressionDx |
|
|
: public FunctionExpression |
|
|
{ |
|
|
public: |
|
|
enum Direction { |
|
|
x, |
|
|
y, |
|
|
z |
|
|
}; |
|
|
|
|
|
private: |
|
|
//! true while function has not been evaluated |
|
|
bool __isToEvaluate; |
|
|
|
|
|
//! xi |
|
|
FunctionExpressionDx::Direction __direction; |
|
|
|
|
|
//! The function to derive |
|
|
ReferenceCounting<FunctionExpression> __function; |
|
|
|
|
|
//! The value of the function |
|
|
ReferenceCounting<FunctionExpression> __functionDxi; |
|
|
|
|
|
std::ostream& put(std::ostream& os) |
|
|
{ |
|
|
switch (__direction) { |
|
|
case (x): { |
|
|
os << "dx("; |
|
|
break; |
|
|
} |
|
|
case (y): { |
|
|
os << "dy("; |
|
|
break; |
|
|
} |
|
|
case (z): { |
|
|
os << "dz("; |
|
|
break; |
|
|
} |
|
|
} |
|
|
os << *__function << ')'; |
|
|
return os; |
|
|
} |
|
|
|
|
|
public: |
|
|
ReferenceCounting<FunctionExpression> value(); |
|
|
|
|
|
const real_t value(const real_t x, |
|
|
const real_t y, |
|
|
const real_t z); |
|
|
|
|
|
void execute(); |
|
|
|
|
|
FunctionExpressionDx(ReferenceCounting<FunctionExpression> function, |
|
|
FunctionExpressionDx::Direction d); |
|
|
|
|
|
FunctionExpressionDx(const FunctionExpressionDx& r); |
|
|
|
|
|
~FunctionExpressionDx(); |
|
|
}; |
|
|
|
|
452 |
class FunctionExpressionVariable |
class FunctionExpressionVariable |
453 |
: public FunctionExpression |
: public FunctionExpression |
454 |
{ |
{ |