00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef VARIATIONAL_OPERATOR_EXPRESSION_HPP
00021 #define VARIATIONAL_OPERATOR_EXPRESSION_HPP
00022
00023 #include <Expression.hpp>
00024
00025 #include <Variable.hpp>
00026
00027 #include <ReferenceCounting.hpp>
00028 #include <FunctionExpression.hpp>
00029
00030 #include <BoundaryExpression.hpp>
00031
00032 #include <VariationalOperator.hpp>
00033
00044 class VariationalBilinearOperatorExpression
00045 : public Expression
00046 {
00047 public:
00048 enum OperatorType {
00049 mugradUgradV,
00050 alphaDxUDxV,
00051 nuDxUV,
00052 nuUdxV,
00053 alphaUV,
00054 };
00055
00056 private:
00057 OperatorType __operatorType;
00059 ReferenceCounting<BoundaryExpression> __border;
00065 void __checkNoBoundaryExpression() const {
00066 if (this->__hasBoundaryExpression()) {
00067 throw ErrorHandler(__FILE__,__LINE__,
00068 "cannot evaluate the expression \""
00069 +stringify(*this)+
00070 "\" in the volume",
00071 ErrorHandler::normal);
00072 }
00073 }
00074
00075 protected:
00080 virtual void __executeRemaining() = 0;
00081 virtual bool __hasBoundaryExpression() const = 0;
00082
00083 std::string __propertyBeginWrite(const VariationalOperator::Property& property) const
00084 {
00085 switch(property) {
00086 case VariationalOperator::mean: {
00087 return "{";
00088 break;
00089 }
00090 case VariationalOperator::jump: {
00091 return "[";
00092 break;
00093 }
00094 default: {
00095 return "";
00096 }
00097 }
00098 }
00099
00100 std::string __propertyEndWrite(const VariationalOperator::Property& property) const
00101 {
00102 switch(property) {
00103 case VariationalOperator::mean: {
00104 return "}";
00105 break;
00106 }
00107 case VariationalOperator::jump: {
00108 return "]";
00109 break;
00110 }
00111 default: {
00112 return "";
00113 }
00114 }
00115 }
00116
00117 std::string __unknownTypeBeginWrite() const
00118 {
00119 return __propertyBeginWrite(__unknownProperty);
00120 }
00121
00122 std::string __unknownTypeEndWrite() const
00123 {
00124 return __propertyEndWrite(__unknownProperty);
00125 }
00126
00127 std::string __testTypeBeginWrite() const
00128 {
00129 return __propertyBeginWrite(__testFunctionProperty);
00130 }
00131
00132 std::string __testTypeEndWrite() const
00133 {
00134 return __propertyEndWrite(__testFunctionProperty);
00135 }
00136
00137 char __directionName(const size_t& i) const
00138 {
00139 switch(i) {
00140 case 0: return 'x';
00141 case 1: return 'y';
00142 case 2: return 'z';
00143 default: {
00144 throw ErrorHandler(__FILE__,__LINE__,": unknown direction",
00145 ErrorHandler::unexpected);
00146 return '0';
00147 }
00148 }
00149 }
00150
00151
00152 const std::string
00153 __unknownName;
00155 const VariationalOperator::Property
00156 __unknownProperty;
00158 const std::string
00159 __testFunctionName;
00161 const VariationalOperator::Property
00162 __testFunctionProperty;
00164 public:
00165
00171 ReferenceCounting<BoundaryExpression> border() const
00172 {
00173 return __border;
00174 }
00175
00180 void execute()
00181 {
00182 if(__border != 0) {
00183 (*__border).execute();
00184 }
00185 __executeRemaining();
00186 if(__border == 0) {
00187 __checkNoBoundaryExpression();
00188 }
00189 }
00190 OperatorType operatorType()
00197 {
00198 return __operatorType;
00199 }
00200
00207 const std::string& unknownName() const
00208 {
00209 return __unknownName;
00210 }
00211
00218 const std::string& testFunctionName() const
00219 {
00220 return __testFunctionName;
00221 }
00222
00228 const VariationalOperator::Property& unknownProperty() const
00229 {
00230 return __unknownProperty;
00231 }
00232
00238 const VariationalOperator::Property& testFunctionProperty() const
00239 {
00240 return __testFunctionProperty;
00241 }
00242
00248 VariationalBilinearOperatorExpression(const VariationalBilinearOperatorExpression& V)
00249 : Expression(V),
00250 __operatorType(V.__operatorType),
00251 __border(V.__border),
00252 __unknownName(V.__unknownName),
00253 __unknownProperty(V.__unknownProperty),
00254 __testFunctionName(V.__testFunctionName),
00255 __testFunctionProperty(V.__testFunctionProperty)
00256 {
00257 ;
00258 }
00259
00270 VariationalBilinearOperatorExpression(VariationalBilinearOperatorExpression::OperatorType type,
00271 ReferenceCounting<BoundaryExpression> border,
00272 const std::string& unknownName,
00273 const VariationalOperator::Property& unknownProperty,
00274 const std::string& testFunctionName,
00275 const VariationalOperator::Property& testFunctionProperty)
00276 : Expression(Expression::variationalBilinearOperator),
00277 __operatorType(type),
00278 __border(border),
00279 __unknownName(unknownName),
00280 __unknownProperty(unknownProperty),
00281 __testFunctionName(testFunctionName),
00282 __testFunctionProperty(testFunctionProperty)
00283 {
00284 ;
00285 }
00286
00291 virtual ~VariationalBilinearOperatorExpression()
00292 {
00293 ;
00294 }
00295 };
00296
00308 class VariationalLinearOperatorExpression
00309 : public Expression
00310 {
00311 public:
00312 enum OperatorType {
00313 FV,
00314 FdxGV,
00315 FdxV,
00316 FgradGgradV
00317 };
00318
00319 private:
00320 const OperatorType
00321 __operatorType;
00323 ReferenceCounting<BoundaryExpression> __border;
00325 virtual void __executeRemaining() = 0;
00326 void __checkNoBoundaryExpression() const {
00327 if (this->__hasBoundaryExpression()) {
00328 throw ErrorHandler(__FILE__,__LINE__,
00329 "cannot evaluate the expression \""
00330 +stringify(*this)+
00331 "\" in the volume",
00332 ErrorHandler::normal);
00333 }
00334 }
00335
00336 protected:
00337
00338 std::string __propertyBeginWrite(const VariationalOperator::Property& property) const
00339 {
00340 switch(property) {
00341 case VariationalOperator::mean: {
00342 return "{";
00343 break;
00344 }
00345 case VariationalOperator::jump: {
00346 return "[";
00347 break;
00348 }
00349 default: {
00350 return "";
00351 }
00352 }
00353 }
00354
00355 std::string __propertyEndWrite(const VariationalOperator::Property& property) const
00356 {
00357 switch(property) {
00358 case VariationalOperator::mean: {
00359 return "}";
00360 break;
00361 }
00362 case VariationalOperator::jump: {
00363 return "]";
00364 break;
00365 }
00366 default: {
00367 return "";
00368 }
00369 }
00370 }
00371
00372 std::string __testTypeBeginWrite() const
00373 {
00374 return __propertyBeginWrite(__testFunctionProperty);
00375 }
00376
00377 std::string __testTypeEndWrite() const
00378 {
00379 return __propertyEndWrite(__testFunctionProperty);
00380 }
00381
00382 virtual bool __hasBoundaryExpression() const = 0;
00383
00384 char __directionName(const size_t& i) const
00385 {
00386 switch(i) {
00387 case 0: return 'x';
00388 case 1: return 'y';
00389 case 2: return 'z';
00390 default: {
00391 throw ErrorHandler(__FILE__,__LINE__,": unknown direction",
00392 ErrorHandler::unexpected);
00393 return '0';
00394 }
00395 }
00396 }
00397
00398 const std::string
00399 __testFunctionName;
00401 const VariationalOperator::Property
00402 __testFunctionProperty;
00404 public:
00410 ReferenceCounting<BoundaryExpression> border() const
00411 {
00412 return __border;
00413 }
00414
00419 void execute()
00420 {
00421 if(__border != 0) {
00422 (*__border).execute();
00423 }
00424 __executeRemaining();
00425 if(__border == 0) {
00426 __checkNoBoundaryExpression();
00427 }
00428
00429 }
00430
00437 OperatorType operatorType()
00438 {
00439 return __operatorType;
00440 }
00441
00448 const std::string& testFunctionName() const
00449 {
00450 return __testFunctionName;
00451 }
00452
00458 VariationalLinearOperatorExpression(const VariationalLinearOperatorExpression& V)
00459 : Expression(V),
00460 __operatorType(V.__operatorType),
00461 __border(V.__border),
00462 __testFunctionName(V.__testFunctionName),
00463 __testFunctionProperty(V.__testFunctionProperty)
00464 {
00465 ;
00466 }
00467
00476 VariationalLinearOperatorExpression(VariationalLinearOperatorExpression::OperatorType type,
00477 ReferenceCounting<BoundaryExpression> border,
00478 const std::string& testFunctionName,
00479 const VariationalOperator::Property& testFunctionProperty)
00480 : Expression(Expression::variationalBilinearOperator),
00481 __operatorType(type),
00482 __border(border),
00483 __testFunctionName(testFunctionName),
00484 __testFunctionProperty(testFunctionProperty)
00485 {
00486 ;
00487 }
00488
00493 virtual ~VariationalLinearOperatorExpression()
00494 {
00495 ;
00496 }
00497 };
00498
00499
00500
00501
00502
00512 class VariationalMuGradUGradVExpression
00513 : public VariationalBilinearOperatorExpression
00514 {
00515 private:
00516 ReferenceCounting<FunctionExpression> __mu;
00518 bool __hasBoundaryExpression() const
00519 {
00520 return (*__mu).hasBoundaryExpression();
00521 }
00522
00523 public:
00524
00531 ReferenceCounting<FunctionExpression> mu()
00532 {
00533 return __mu;
00534 }
00535
00540 void __executeRemaining()
00541 {
00542 (*__mu).execute();
00543 }
00544
00552 std::ostream& put(std::ostream& os) const
00553 {
00554 os << *__mu
00555 << '*'
00556 << this->__unknownTypeBeginWrite()
00557 << "grad(" << __unknownName << ')'
00558 << this->__unknownTypeEndWrite()
00559 << '*'
00560 << this->__testTypeBeginWrite()
00561 << "grad(" << __testFunctionName << ')'
00562 << this->__testTypeEndWrite();
00563 return os;
00564 }
00565
00576 VariationalMuGradUGradVExpression(ReferenceCounting<FunctionExpression> mu,
00577 const std::string& unknownName,
00578 const VariationalOperator::Property& unknownProperty,
00579 const std::string& testFunctionName,
00580 const VariationalOperator::Property& testFunctionProperty,
00581 ReferenceCounting<BoundaryExpression> border = 0)
00582 : VariationalBilinearOperatorExpression(VariationalBilinearOperatorExpression::
00583 mugradUgradV,
00584 border,
00585 unknownName,
00586 unknownProperty,
00587 testFunctionName,
00588 testFunctionProperty),
00589 __mu(mu)
00590 {
00591 ;
00592 }
00593
00600 VariationalMuGradUGradVExpression(const VariationalMuGradUGradVExpression& V)
00601 : VariationalBilinearOperatorExpression(V),
00602 __mu(V.__mu)
00603 {
00604 ;
00605 }
00606
00607
00613 ~VariationalMuGradUGradVExpression()
00614 {
00615 ;
00616 }
00617 };
00618
00619
00629 class VariationalAlphaDxUDxVExpression
00630 : public VariationalBilinearOperatorExpression
00631 {
00632 private:
00633 ReferenceCounting<FunctionExpression> __Alpha;
00634 size_t __i;
00635 size_t __j;
00644 std::ostream& put(std::ostream& os) const
00645 {
00646 os << *__Alpha
00647 << '*'
00648 << this->__unknownTypeBeginWrite()
00649 << 'd' << __directionName(__j) << '(' << __unknownName << ')'
00650 << this->__unknownTypeEndWrite()
00651 << '*'
00652 << this->__testTypeBeginWrite()
00653 << 'd' << __directionName(__i) << '(' << __testFunctionName << ')'
00654 << this->__testTypeEndWrite();
00655 return os;
00656 }
00657
00658 bool __hasBoundaryExpression() const
00659 {
00660 return (*__Alpha).hasBoundaryExpression();
00661 }
00662
00663 public:
00670 ReferenceCounting<FunctionExpression> alpha()
00671 {
00672 return __Alpha;
00673 }
00674
00681 const size_t& i() const
00682 {
00683 return __i;
00684 }
00685
00692 const size_t& j() const
00693 {
00694 return __j;
00695 }
00696
00701 void __executeRemaining()
00702 {
00703 (*__Alpha).execute();
00704 }
00705
00718 VariationalAlphaDxUDxVExpression(ReferenceCounting<FunctionExpression> alpha,
00719 const size_t i,
00720 const size_t j,
00721 const std::string& unknownName,
00722 const VariationalOperator::Property& unknownProperty,
00723 const std::string& testFunctionName,
00724 const VariationalOperator::Property& testFunctionProperty,
00725 ReferenceCounting<BoundaryExpression> border = 0)
00726 : VariationalBilinearOperatorExpression(VariationalBilinearOperatorExpression::
00727 alphaDxUDxV,
00728 border,
00729 unknownName,
00730 unknownProperty,
00731 testFunctionName,
00732 testFunctionProperty),
00733 __Alpha(alpha),
00734 __i(i),
00735 __j(j)
00736 {
00737 ;
00738 }
00739
00746 VariationalAlphaDxUDxVExpression(const VariationalAlphaDxUDxVExpression& V)
00747 : VariationalBilinearOperatorExpression(V),
00748 __Alpha(V.__Alpha),
00749 __i(V.__i),
00750 __j(V.__j)
00751 {
00752 ;
00753 }
00754
00760 ~VariationalAlphaDxUDxVExpression()
00761 {
00762 ;
00763 }
00764 };
00765
00766
00767
00777 class VariationalNuUdxVExpression
00778 : public VariationalBilinearOperatorExpression
00779 {
00780 private:
00781 ReferenceCounting<FunctionExpression> __nu;
00782 size_t __number;
00791 std::ostream& put(std::ostream& os) const
00792 {
00793 os << *__nu
00794 << '*'
00795 << this->__unknownTypeBeginWrite()
00796 << __unknownName
00797 << this->__unknownTypeEndWrite()
00798 << '*'
00799 << this->__testTypeBeginWrite()
00800 << 'd' << __directionName(__number) << '(' << __testFunctionName << ')'
00801 << this->__testTypeEndWrite();
00802
00803 return os;
00804 }
00805
00806 bool __hasBoundaryExpression() const
00807 {
00808 return (*__nu).hasBoundaryExpression();
00809 }
00810
00811 public:
00818 ReferenceCounting<FunctionExpression> nu()
00819 {
00820 return __nu;
00821 }
00822
00829 const size_t& number() const
00830 {
00831 return __number;
00832 }
00833
00838 void __executeRemaining()
00839 {
00840 (*__nu).execute();
00841 }
00842
00854 VariationalNuUdxVExpression(ReferenceCounting<FunctionExpression> nu,
00855 const size_t& number,
00856 const std::string& unknownName,
00857 const VariationalOperator::Property& unknownProperty,
00858 const std::string& testFunctionName,
00859 const VariationalOperator::Property& testFunctionProperty,
00860 ReferenceCounting<BoundaryExpression> border = 0)
00861 : VariationalBilinearOperatorExpression(VariationalBilinearOperatorExpression::
00862 nuUdxV,
00863 border,
00864 unknownName,
00865 unknownProperty,
00866 testFunctionName,
00867 testFunctionProperty),
00868 __nu(nu),
00869 __number(number)
00870 {
00871 ;
00872 }
00873
00880 VariationalNuUdxVExpression(const VariationalNuUdxVExpression& V)
00881 : VariationalBilinearOperatorExpression(V),
00882 __nu(V.__nu),
00883 __number(V.__number)
00884 {
00885 ;
00886 }
00887
00893 ~VariationalNuUdxVExpression()
00894 {
00895 ;
00896 }
00897 };
00898
00908 class VariationalNuDxUVExpression
00909 : public VariationalBilinearOperatorExpression
00910 {
00911 private:
00912 ReferenceCounting<FunctionExpression> __nu;
00913 size_t __number;
00922 std::ostream& put(std::ostream& os) const
00923 {
00924 os << *__nu
00925 << '*'
00926 << this->__unknownTypeBeginWrite()
00927 << 'd' << __directionName(__number) << '(' << __unknownName << ')'
00928 << this->__unknownTypeEndWrite()
00929 << '*'
00930 << this->__testTypeBeginWrite()
00931 << __testFunctionName
00932 << this->__testTypeEndWrite();
00933 return os;
00934 }
00935
00936 bool __hasBoundaryExpression() const
00937 {
00938 return (*__nu).hasBoundaryExpression();
00939 }
00940
00941 public:
00948 ReferenceCounting<FunctionExpression> nu()
00949 {
00950 return __nu;
00951 }
00952
00959 const size_t& number() const
00960 {
00961 return __number;
00962 }
00963
00968 void __executeRemaining()
00969 {
00970 (*__nu).execute();
00971 }
00972
00984 VariationalNuDxUVExpression(ReferenceCounting<FunctionExpression> nu,
00985 const size_t& number,
00986 const std::string& unknownName,
00987 const VariationalOperator::Property& unknownProperty,
00988 const std::string& testFunctionName,
00989 const VariationalOperator::Property& testFunctionProperty,
00990 ReferenceCounting<BoundaryExpression> border = 0)
00991 : VariationalBilinearOperatorExpression(VariationalBilinearOperatorExpression::
00992 nuDxUV,
00993 border,
00994 unknownName,
00995 unknownProperty,
00996 testFunctionName,
00997 testFunctionProperty),
00998 __nu(nu),
00999 __number(number)
01000 {
01001 ;
01002 }
01003
01010 VariationalNuDxUVExpression(const VariationalNuDxUVExpression& V)
01011 : VariationalBilinearOperatorExpression(V),
01012 __nu(V.__nu),
01013 __number(V.__number)
01014 {
01015 ;
01016 }
01017
01023 ~VariationalNuDxUVExpression()
01024 {
01025 ;
01026 }
01027 };
01028
01029
01039 class VariationalAlphaUVExpression
01040 : public VariationalBilinearOperatorExpression
01041 {
01042 private:
01043 ReferenceCounting<FunctionExpression> __Alpha;
01045 bool __hasBoundaryExpression() const
01046 {
01047 return (*__Alpha).hasBoundaryExpression();
01048 }
01049
01054 void __executeRemaining()
01055 {
01056 (*__Alpha).execute();
01057 }
01058
01059 public:
01060 ReferenceCounting<FunctionExpression> alpha()
01061 {
01062 return __Alpha;
01063 }
01064
01072 std::ostream& put(std::ostream& os) const
01073 {
01074 os << *__Alpha
01075 << '*'
01076 << this->__unknownTypeBeginWrite()
01077 << __unknownName
01078 << this->__unknownTypeEndWrite()
01079 << '*'
01080 << this->__testTypeBeginWrite()
01081 << __testFunctionName
01082 << this->__testTypeEndWrite();
01083 return os;
01084 }
01085
01096 VariationalAlphaUVExpression(ReferenceCounting<FunctionExpression> alpha,
01097 const std::string& unknownName,
01098 const VariationalOperator::Property& unknownProperty,
01099 const std::string& testFunctionName,
01100 const VariationalOperator::Property& testFunctionProperty,
01101 ReferenceCounting<BoundaryExpression> border = 0)
01102 : VariationalBilinearOperatorExpression(VariationalBilinearOperatorExpression::alphaUV,
01103 border,
01104 unknownName,
01105 unknownProperty,
01106 testFunctionName,
01107 testFunctionProperty),
01108 __Alpha(alpha)
01109 {
01110 ;
01111 }
01112
01119 VariationalAlphaUVExpression(const VariationalAlphaUVExpression& V)
01120 : VariationalBilinearOperatorExpression(V),
01121 __Alpha(V.__Alpha)
01122 {
01123 ;
01124 }
01125
01131 ~VariationalAlphaUVExpression()
01132 {
01133 ;
01134 }
01135 };
01136
01137
01138
01139
01140
01141
01151 class VariationalFVExpression
01152 : public VariationalLinearOperatorExpression
01153 {
01154 private:
01155 ReferenceCounting<FunctionExpression> __f;
01161 void __executeRemaining()
01162 {
01163 (*__f).execute();
01164 }
01165
01166
01167 bool __hasBoundaryExpression() const
01168 {
01169 return (*__f).hasBoundaryExpression();
01170 }
01171
01179 std::ostream& put(std::ostream& os) const
01180 {
01181 os << *__f
01182 << '*'
01183 << this->__testTypeBeginWrite()
01184 << __testFunctionName
01185 << this->__testTypeEndWrite();
01186 return os;
01187 }
01188
01189 public:
01190
01197 ReferenceCounting<FunctionExpression> f()
01198 {
01199 return __f;
01200 }
01201
01211 VariationalFVExpression(ReferenceCounting<FunctionExpression> f,
01212 const std::string& testFunctionName,
01213 const VariationalOperator::Property& testFunctionProperty,
01214 ReferenceCounting<BoundaryExpression> border = 0)
01215 : VariationalLinearOperatorExpression(VariationalLinearOperatorExpression::FV,
01216 border, testFunctionName, testFunctionProperty),
01217 __f(f)
01218 {
01219 ;
01220 }
01221
01228 VariationalFVExpression(const VariationalFVExpression& V)
01229 : VariationalLinearOperatorExpression(V),
01230 __f(V.__f)
01231 {
01232 ;
01233 }
01234
01240 ~VariationalFVExpression()
01241 {
01242 ;
01243 }
01244 };
01245
01253 class VariationalFdxGVExpression
01254 : public VariationalLinearOperatorExpression
01255 {
01256 private:
01257 ReferenceCounting<FunctionExpression> __f;
01258 ReferenceCounting<FunctionExpression> __g;
01259 const size_t __number;
01261 bool __hasBoundaryExpression() const
01262 {
01263 return ((*__f).hasBoundaryExpression() or
01264 (*__g).hasBoundaryExpression());
01265 }
01266
01271 void __executeRemaining()
01272 {
01273 (*__f).execute();
01274 (*__g).execute();
01275 }
01276
01284 std::ostream& put(std::ostream& os) const
01285 {
01286 os << *__f << '*'
01287 << 'd'<< __directionName(__number) << '(' << *__g << ')'
01288 << this->__testTypeBeginWrite()
01289 << '*' << __testFunctionName
01290 << this->__testTypeEndWrite();
01291 return os;
01292 }
01293
01294 public:
01300 const size_t& number() const
01301 {
01302 return __number;
01303 }
01304
01311 ReferenceCounting<FunctionExpression> f()
01312 {
01313 return __f;
01314 }
01315
01322 ReferenceCounting<FunctionExpression> g()
01323 {
01324 return __g;
01325 }
01326
01338 VariationalFdxGVExpression(ReferenceCounting<FunctionExpression> f,
01339 ReferenceCounting<FunctionExpression> g,
01340 const std::string& testFunctionName,
01341 const VariationalOperator::Property& testFunctionProperty,
01342 const size_t& n,
01343 ReferenceCounting<BoundaryExpression> border = 0)
01344 : VariationalLinearOperatorExpression(VariationalLinearOperatorExpression::FdxGV,
01345 border, testFunctionName, testFunctionProperty),
01346 __f(f),
01347 __g(g),
01348 __number(n)
01349 {
01350 ;
01351 }
01352
01359 VariationalFdxGVExpression(const VariationalFdxGVExpression& V)
01360 : VariationalLinearOperatorExpression(V),
01361 __f(V.__f),
01362 __g(V.__g),
01363 __number(V.__number)
01364 {
01365 ;
01366 }
01367
01368
01374 ~VariationalFdxGVExpression()
01375 {
01376 ;
01377 }
01378 };
01379
01387 class VariationalFdxVExpression
01388 : public VariationalLinearOperatorExpression
01389 {
01390 private:
01391 ReferenceCounting<FunctionExpression> __f;
01392 const size_t __number;
01394 bool __hasBoundaryExpression() const
01395 {
01396 return __f->hasBoundaryExpression();
01397 }
01398
01403 void __executeRemaining()
01404 {
01405 __f->execute();
01406 }
01407
01415 std::ostream& put(std::ostream& os) const
01416 {
01417 os << *__f << '*'
01418 << this->__testTypeBeginWrite()
01419 <<'d'<< __directionName(__number) << '(' << __testFunctionName << ')'
01420 << this->__testTypeEndWrite();
01421 return os;
01422 }
01423
01424 public:
01430 const size_t& number() const
01431 {
01432 return __number;
01433 }
01434
01441 ReferenceCounting<FunctionExpression> f()
01442 {
01443 return __f;
01444 }
01445
01455 VariationalFdxVExpression(ReferenceCounting<FunctionExpression> f,
01456 const std::string& testFunctionName,
01457 const VariationalOperator::Property& testFunctionProperty,
01458 const size_t& n,
01459 ReferenceCounting<BoundaryExpression> border = 0)
01460 : VariationalLinearOperatorExpression(VariationalLinearOperatorExpression::FdxV,
01461 border, testFunctionName, testFunctionProperty),
01462 __f(f),
01463 __number(n)
01464 {
01465 ;
01466 }
01467
01474 VariationalFdxVExpression(const VariationalFdxVExpression& V)
01475 : VariationalLinearOperatorExpression(V),
01476 __f(V.__f),
01477 __number(V.__number)
01478 {
01479 ;
01480 }
01481
01487 ~VariationalFdxVExpression()
01488 {
01489 ;
01490 }
01491 };
01492
01501 class VariationalFgradGgradVExpression
01502 : public VariationalLinearOperatorExpression
01503 {
01504 private:
01505 ReferenceCounting<FunctionExpression> __f;
01506 ReferenceCounting<FunctionExpression> __g;
01512 void __executeRemaining()
01513 {
01514 (*__f).execute();
01515 (*__g).execute();
01516 }
01517
01518 bool __hasBoundaryExpression() const
01519 {
01520 return ((*__f).hasBoundaryExpression() or
01521 (*__g).hasBoundaryExpression());
01522 }
01523
01531 std::ostream& put(std::ostream& os) const
01532 {
01533 os << *__f << "*grad("<< *__g << ')'
01534 <<'*'
01535 << this->__testTypeBeginWrite()
01536 << "grad(" << __testFunctionName << ')'
01537 << this->__testTypeEndWrite();
01538 return os;
01539 }
01540
01541 public:
01548 ReferenceCounting<FunctionExpression> f()
01549 {
01550 return __f;
01551 }
01552
01559 ReferenceCounting<FunctionExpression> g()
01560 {
01561 return __g;
01562 }
01563
01564
01574 VariationalFgradGgradVExpression(ReferenceCounting<FunctionExpression> f,
01575 ReferenceCounting<FunctionExpression> g,
01576 const std::string& testFunctionName,
01577 const VariationalOperator::Property& testFunctionProperty,
01578 ReferenceCounting<BoundaryExpression> border = 0)
01579 : VariationalLinearOperatorExpression(VariationalLinearOperatorExpression::FgradGgradV,
01580 border, testFunctionName, testFunctionProperty),
01581 __f(f),
01582 __g(g)
01583 {
01584 ;
01585 }
01586
01593 VariationalFgradGgradVExpression(const VariationalFgradGgradVExpression& V)
01594 : VariationalLinearOperatorExpression(V),
01595 __f(V.__f),
01596 __g(V.__g)
01597 {
01598 ;
01599 }
01600
01601
01607 ~VariationalFgradGgradVExpression()
01608 {
01609 ;
01610 }
01611 };
01612
01613 #endif // VARIATIONAL_OPERATOR_EXPRESSION_HPP
01614