Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef SUNDANCE_CELLVECTOREXPR_H
00043 #define SUNDANCE_CELLVECTOREXPR_H
00044
00045 #include "SundanceEvaluatorFactory.hpp"
00046 #include "SundanceCellVectorEvaluator.hpp"
00047 #include "SundanceExpr.hpp"
00048
00049 namespace Sundance
00050 {
00051 using namespace Sundance;
00052 using namespace Sundance;
00053
00054
00055 enum CellVectorExprType {CellNormalVector, CellTangentSpace};
00056
00057
00058
00059
00060
00061
00062 class CellVectorExpr
00063 : public EvaluatableExpr,
00064 public GenericEvaluatorFactory<CellVectorExpr, CellVectorEvaluator>
00065 {
00066 public:
00067
00068 CellVectorExpr(
00069 int normalComponentIndex,
00070 int dimension,
00071 const std::string& name
00072 );
00073
00074
00075 CellVectorExpr(
00076 int tangentBasisIndex,
00077 int tangentComponentIndex,
00078 int dimension,
00079 const std::string& name
00080 );
00081
00082
00083
00084
00085 virtual ~CellVectorExpr() {;}
00086
00087
00088 bool isTangent() const {return type_ == CellTangentSpace;}
00089
00090
00091 bool isNormal() const {return !isTangent();}
00092
00093
00094 int componentIndex() const {return componentIndex_;}
00095
00096
00097 int basisMemberIndex() const {return basisMemberIndex_;}
00098
00099
00100 int dimension() const {return dim_;}
00101
00102
00103 virtual XMLObject toXML() const ;
00104
00105 const std::string& name() const {return name_;}
00106
00107
00108
00109 virtual std::ostream& toText(std::ostream& os, bool paren) const ;
00110
00111
00112
00113 virtual Set<MultipleDeriv>
00114 internalFindW(int order, const EvalContext& context) const ;
00115
00116
00117 virtual RCP<ExprBase> getRcp() {return rcp(this);}
00118
00119
00120 virtual bool lessThan(const ScalarExpr* other) const ;
00121 private:
00122 std::string name_;
00123 int dim_;
00124 CellVectorExprType type_;
00125 int basisMemberIndex_;
00126 int componentIndex_;
00127
00128 };
00129
00130
00131
00132 Expr CellNormalExpr(int dimension, const std::string& name);
00133
00134
00135 Expr CellTangentExpr(int dimension, const std::string& name);
00136
00137 }
00138
00139 #endif