Commit 22e8b9ab authored by jonathan.wunderlich's avatar jonathan.wunderlich
Browse files

[419-use-iterators-for-elements2] extended some elements

parent b4be3dee
......@@ -20,26 +20,38 @@ public:
MixedScalarElementT(const VectorMatrixBase &g, const BasicElementT<TT, sDim, tDim> &baseElement);
TT Value(int q, int n, int i) const {
return (*shapeValues[n])[q][i];
}
TT Value(int q, int n, int i) const { return (*shapeValues[n])[q][i]; }
TT Value(int q, int n, const ShapeId &iter) const { return (*shapeValues[n])[q][iter.id]; }
TT Value(const PointT<TT, sDim, tDim> &z, int n, int i) const {
return (*this->shapes[n])(z, i);
}
TT Value(const PointT<TT, sDim, tDim> &z, int n, const ShapeId &iter) const {
return (*this->shapes[n])(z, iter.id);
}
TT Value(int q, const Vector &u, int n, int k = 0) const;
TT Value(const PointT<TT, sDim, tDim> &z, const Vector &u, int n, int k = 0) const;
VectorFieldT<TT, sDim> Derivative(int q, int n, int i) const {
const VectorFieldT<TT, sDim> &Derivative(int q, int n, int i) const {
return shapeGradients[n][q][i];
}
const VectorFieldT<TT, sDim> &Derivative(int q, int n, const ShapeId &iter) const {
return shapeGradients[n][q][iter.id];
}
VectorFieldT<TT, sDim> Derivative(const PointT<TT, sDim, tDim> &z, int n, int i) const {
return this->GetTransformation(z) * this->shapes[n]->LocalGradient(z, i);
}
VectorFieldT<TT, sDim> Derivative(const PointT<TT, sDim, tDim> &z, int n, const ShapeId &iter) const {
return this->GetTransformation(z) * this->shapes[n]->LocalGradient(z, iter.id);
}
VectorFieldT<TT, sDim> Derivative(int q, const Vector &u, int n, int k = 0) const;
VectorFieldT<TT, sDim> Derivative(const PointT<TT, sDim, tDim> &z, const Vector &u,
......
......@@ -26,10 +26,18 @@ public:
return VectorFieldT<TT, sDim>(k, this->Value(q, n, i));
}
VectorFieldT<TT, sDim> VectorValue(int q, int n, const ShapeId &iter, int k) const {
return VectorFieldT<TT, sDim>(k, this->Value(q, n, iter));
}
VectorFieldT<TT, sDim> VectorValue(const PointT<TT, sDim, tDim> &z, int n, int i, int k) const {
return VectorFieldT<TT, sDim>(k, this->Value(z, n, i));
}
VectorFieldT<TT, sDim> VectorValue(const PointT<TT, sDim, tDim> &z, int n, const ShapeId &iter, int k) const {
return VectorFieldT<TT, sDim>(k, this->Value(z, n, iter));
}
VectorFieldT<TT, sDim> VectorValue(int q, const Vector &u, int n) const;
VectorFieldT<TT, sDim> VectorValue(const PointT<TT, sDim, tDim> &z, const Vector &u, int n) const;
......@@ -38,10 +46,18 @@ public:
return TensorT<TT, sDim>(this->Derivative(q, n, i), k);
}
TensorT<TT, sDim> VectorGradient(int q, int n, const ShapeId &iter, int k) const {
return TensorT<TT, sDim>(this->Derivative(q, n, iter), k);
}
TensorT<TT, sDim> VectorGradient(const PointT<TT, sDim, tDim> &z, int n, int i, int k) const {
return TensorT<TT, sDim>(this->Derivative(z, n, i), k);
}
TensorT<TT, sDim> VectorGradient(const PointT<TT, sDim, tDim> &z, int n, const ShapeId &iter, int k) const {
return TensorT<TT, sDim>(this->Derivative(z, n, iter), k);
}
TensorT<TT, sDim> VectorGradient(int q, const Vector &u, int n) const;
TensorT<TT, sDim> VectorGradient(const PointT<TT, sDim, tDim> &z, const Vector &u, int n) const;
......@@ -50,10 +66,18 @@ public:
return this->Derivative(q, n, i)[k];
}
TT Divergence(int q, int n, const ShapeId &iter, int k) const {
return this->Derivative(q, n, iter)[k];
}
TT Divergence(const PointT<TT, sDim, tDim> &z, int n, int i, int k) const {
return this->Derivative(z, n, i)[k];
}
TT Divergence(const PointT<TT, sDim, tDim> &z, int n, const ShapeId &iter, int k) const {
return this->Derivative(z, n, iter)[k];
}
TT Divergence(int q, const Vector &u, int n) const;
TT Divergence(const PointT<TT, sDim, tDim> &z, const Vector &u, int n) const;
......
......@@ -5,17 +5,28 @@ TT TaylorHoodElementT<TT, sDim, tDim>::PressureValue(int q, int i) const {
return this->Value(q, 1, i);
}
template<typename TT, int sDim, int tDim>
TT TaylorHoodElementT<TT, sDim, tDim>::PressureValue(int q, const ShapeId &iter) const {
return this->Value(q, 1, iter);
}
template<typename TT, int sDim, int tDim>
TT TaylorHoodElementT<TT, sDim, tDim>::PressureValue(int q, const Vector &u) const {
return this->Value(q, u, 1);
}
template<typename TT, int sDim, int tDim>
VectorFieldT<TT, sDim>
TaylorHoodElementT<TT, sDim, tDim>::PressureGradient(int q, int i) const {
const VectorFieldT<TT, sDim>
&TaylorHoodElementT<TT, sDim, tDim>::PressureGradient(int q, int i) const {
return this->Derivative(q, 1, i);
}
template<typename TT, int sDim, int tDim>
const VectorFieldT<TT, sDim>
&TaylorHoodElementT<TT, sDim, tDim>::PressureGradient(int q, const ShapeId &iter) const {
return this->Derivative(q, 1, iter);
}
template<typename TT, int sDim, int tDim>
VectorFieldT<TT, sDim>
TaylorHoodElementT<TT, sDim, tDim>::PressureGradient(int q, const Vector &u) const {
......@@ -28,6 +39,12 @@ TaylorHoodElementT<TT, sDim, tDim>::VelocityField(int q, int i, int k) const {
return this->VectorValue(q, 0, i, k);
}
template<typename TT, int sDim, int tDim>
VectorFieldT<TT, sDim>
TaylorHoodElementT<TT, sDim, tDim>::VelocityField(int q, const ShapeId &iter, int k) const {
return this->VectorValue(q, 0, iter, k);
}
template<typename TT, int sDim, int tDim>
VectorFieldT<TT, sDim>
TaylorHoodElementT<TT, sDim, tDim>::VelocityField(int q, const Vector &u) const {
......@@ -40,6 +57,12 @@ TaylorHoodElementT<TT, sDim, tDim>::VelocityFieldGradient(int q, int i, int k) c
return this->VectorGradient(q, 0, i, k);
}
template<typename TT, int sDim, int tDim>
TensorT<TT, sDim>
TaylorHoodElementT<TT, sDim, tDim>::VelocityFieldGradient(int q, const ShapeId &iter, int k) const {
return this->VectorGradient(q, 0, iter, k);
}
template<typename TT, int sDim, int tDim>
TensorT<TT, sDim>
TaylorHoodElementT<TT, sDim, tDim>::VelocityFieldGradient(int q, const Vector &u) const {
......@@ -51,6 +74,11 @@ TT TaylorHoodElementT<TT, sDim, tDim>::VelocityFieldDivergence(int q, int i, int
return this->Divergence(q, 0, i, k);
}
template<typename TT, int sDim, int tDim>
TT TaylorHoodElementT<TT, sDim, tDim>::VelocityFieldDivergence(int q, const ShapeId &iter, int k) const {
return this->Divergence(q, 0, iter, k);
}
template<typename TT, int sDim, int tDim>
TT TaylorHoodElementT<TT, sDim, tDim>::VelocityFieldDivergence(int q, const Vector &u) const {
return this->Divergence(q, u, 0);
......
......@@ -27,22 +27,32 @@ public:
TT PressureValue(int q, int i) const;
TT PressureValue(int q, const ShapeId &iter) const;
TT PressureValue(int q, const Vector &u) const;
VectorFieldT<TT, sDim> PressureGradient(int q, int i) const;
const VectorFieldT<TT, sDim> &PressureGradient(int q, int i) const;
const VectorFieldT<TT, sDim> &PressureGradient(int q, const ShapeId &iter) const;
VectorFieldT<TT, sDim> PressureGradient(int q, const Vector &u) const;
VectorFieldT<TT, sDim> VelocityField(int q, int i, int k) const;
VectorFieldT<TT, sDim> VelocityField(int q, const ShapeId &iter, int k) const;
VectorFieldT<TT, sDim> VelocityField(int q, const Vector &u) const;
TensorT<TT, sDim> VelocityFieldGradient(int q, int i, int k) const;
TensorT<TT, sDim> VelocityFieldGradient(int q, const ShapeId &iter, int k) const;
TensorT<TT, sDim> VelocityFieldGradient(int q, const Vector &u) const;
TT VelocityFieldDivergence(int q, int i, int k) const;
TT VelocityFieldDivergence(int q, const ShapeId &iter, int k) const;
TT VelocityFieldDivergence(int q, const Vector &u) const;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment