Commit 704f00e8 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

fixed rt for interval

parent d060fac4
#include "RaviartThomasShape.hpp"
double RT0tri::LocalDiv(const Point &z, int i) const {
double RT0Int::LocalDiv(const Point &z, int i) const {
return 1.0;
}
VectorField RT0Int::LocalVector(const Point &z, int i) const {
switch(i) {
case 0:
return VectorField(z[0] - 1, 0.0, 0.0);
case 1:
return VectorField(z[0], 0.0, 0.0);
default: Exit("Not implemented")
}
}
double RT0Tri::LocalDiv(const Point &z, int i) const {
return 2.0;
}
VectorField RT0quad::LocalVector(const Point &z, int i) const {
switch (i) {
case 0:return VectorField(0.0, z[1] - 1.0);
case 1:return VectorField(z[0], 0.0);
case 2:return VectorField(0.0, z[1]);
case 3:return VectorField(z[0] - 1.0, 0.0);
VectorField RT0Tri::LocalVector(const Point &z, int i) const {
switch(i) {
case 0:
return VectorField(z[0], z[1] - 1.0);
case 1:
return VectorField(z[0], z[1]);
case 2:
return VectorField(z[0] - 1.0, z[1]);
default: Exit("Not implemented")
}
Exit("Not implemented");
return 0.0;
}
double RT0quad::LocalDiv(const Point &z, int i) const {
double RT0Quad::LocalDiv(const Point &z, int i) const {
return 1.0;
}
VectorField RT0tet::LocalVector(const Point &z, int i) const {
return zero;
VectorField RT0Quad::LocalVector(const Point &z, int i) const {
switch(i) {
case 0:
return VectorField(0.0, z[1] - 1.0);
case 1:
return VectorField(z[0], 0.0);
case 2:
return VectorField(0.0, z[1]);
case 3:
return VectorField(z[0] - 1.0, 0.0);
default: Exit("Not implemented")
}
}
double RT0Tet::LocalDiv(const Point &z, int i) const {
Exit("Not implemented")
}
double RT0tet::LocalDiv(const Point &z, int i) const {
return 0.0;
VectorField RT0Tet::LocalVector(const Point &z, int i) const {
Exit("Not implemented")
}
VectorField RT0hex::LocalVector(const Point &z, int i) const {
switch (i) {
case 0:return VectorField(0.0, 0.0, z[2] - 1.0);
case 1:return VectorField(0.0, z[1] - 1.0, 0.0);
case 2:return VectorField(z[0], 0.0, 0.0);
case 3:return VectorField(0.0, z[1], 0.0);
case 4:return VectorField(z[0] - 1.0, 0.0, 0.0);
case 5:return VectorField(0.0, 0.0, z[2]);
switch(i) {
case 0:
return VectorField(0.0, 0.0, z[2] - 1.0);
case 1:
return VectorField(0.0, z[1] - 1.0, 0.0);
case 2:
return VectorField(z[0], 0.0, 0.0);
case 3:
return VectorField(0.0, z[1], 0.0);
case 4:
return VectorField(z[0] - 1.0, 0.0, 0.0);
case 5:
return VectorField(0.0, 0.0, z[2]);
default: Exit("Not implemented")
}
Exit("Not implemented");
return 0.0;
}
VectorField RT0tri::LocalVector(const Point &z, int i) const {
switch (i) {
case 0:return VectorField(z[0], z[1] - 1.0);
case 1:return VectorField(z[0], z[1]);
case 2:return VectorField(z[0] - 1.0, z[1]);
}
Exit("Not implemented");
return 0.0;
}
\ No newline at end of file
double RT0hex::LocalDiv(const Point &z, int i) const {
return 1.0;
}
......@@ -9,69 +9,68 @@ public:
RT0Int(const Quadrature &quadrature, const Quadrature &faceQuadrature) :
Shape(quadrature, faceQuadrature, 1, 0, 0) {
}
VectorField LocalVector(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const override;
const char *Name() const override { return "RT0tri"; }
};
class RT0tri : public Shape {
class RT0Tri : public Shape {
public:
const char *Name() const { return "RT0tri"; }
RT0tri(const Quadrature &Q, const Quadrature &FaceQ = GetQuadrature("Qint1"))
:
Shape(Q, FaceQ, 2, 3, 3) {
RT0Tri(const Quadrature &quadrature, const Quadrature &faceQuadrature) :
Shape(quadrature, faceQuadrature, 2, 3, 3) {
// fill(*this);
}
VectorField LocalVector(const Point &z, int i) const;
VectorField LocalVector(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const;
const char *Name() const override { return "RT0tri"; }
};
class RT0quad : public Shape {
class RT0Quad : public Shape {
public:
const char *Name() const { return "RT0quad"; }
RT0quad(const Quadrature &Q,
const Quadrature &FaceQ = GetQuadrature("Qint1"))
:
Shape(Q, FaceQ, 2, 4, 4) {
RT0Quad(const Quadrature &quadrature, const Quadrature &faceQuadrature)
: Shape(quadrature, faceQuadrature, 2, 4, 4) {
// fill(*this);
}
VectorField LocalVector(const Point &z, int i) const;
VectorField LocalVector(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const;
double LocalDiv(const Point &z, int i) const override;
const char *Name() const override { return "RT0quad"; }
};
class RT0tet : public Shape {
class RT0Tet : public Shape {
public:
const char *Name() const { return "RT0tet"; }
RT0tet(const Quadrature &Q,
const Quadrature &FaceQ = GetQuadrature("Qint1"))
:
Shape(Q, FaceQ, 3, 4, 4) {
RT0Tet(const Quadrature &quadrature, const Quadrature &faceQuadrature) :
Shape(quadrature, faceQuadrature, 3, 4, 4) {
// fill(*this);
}
VectorField LocalVector(const Point &z, int i) const;
VectorField LocalVector(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const;
const char *Name() const override { return "RT0tet"; }
};
class RT0hex : public Shape {
public:
const char *Name() const { return "RT0hex"; }
RT0hex(const Quadrature &Q,
const Quadrature &FaceQ = GetQuadrature("Qint1"))
:
Shape(Q, FaceQ, 3, 6, 6) {
RT0hex(const Quadrature &quadrature, const Quadrature &faceQuadrature) :
Shape(quadrature, faceQuadrature, 3, 6, 6) {
// fill(*this);
}
VectorField LocalVector(const Point &z, int i) const;
VectorField LocalVector(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const override;
double LocalDiv(const Point &z, int i) const;
const char *Name() const override { return "RT0hex"; }
};
#endif //RAVIARTTHOMASSHAPE_HPP
......@@ -1513,10 +1513,6 @@ public:
}
};
double RT0hex::LocalDiv(const Point &z, int i) const {
return 1.0;
}
Shape *Get_Shape(const string &name) {
if (name == "P0Int")
return new P0Int(GetQuadrature("Qint1"), GetQuadrature("Qint1"));
......@@ -1640,12 +1636,15 @@ Shape *Get_Shape(const string &name) {
return new P2curl_tet(GetQuadrature("Qtet11"), GetQuadrature("Qtri7"));
if (name == "CR_P1tri")
return new CR_P1tri(GetQuadrature("Qtri3"), GetQuadrature("Qint1"));
if (name == "RT0int")
return new RT0Int(GetQuadrature("Qint2"), GetQuadrature("Qint1"));
if (name == "RT0tri")
return new RT0tri(GetQuadrature("Qtri3"), GetQuadrature("Qint1"));
return new RT0Tri(GetQuadrature("Qtri3"), GetQuadrature("Qint1"));
if (name == "RT0quad")
return new RT0quad(GetQuadrature("Qquad4"), GetQuadrature("Qint1"));
return new RT0Quad(GetQuadrature("Qquad4"), GetQuadrature("Qint1"));
if (name == "RT0tet")
return new RT0tet(GetQuadrature("Qtet4"), GetQuadrature("Qtri1"));
return new RT0Tet(GetQuadrature("Qtet4"), GetQuadrature("Qtri1"));
if (name == "RT0hex")
return new RT0hex(GetQuadrature("Qhex8"), GetQuadrature("Qquad1"));
Exit(name + " not implemented");
......@@ -1754,18 +1753,17 @@ Shape *Get_Shape(const string &name, const Quadrature &quadrature,
return new CR_P1tri(quadrature, faceQuadrature);
// Raviart–Thomas
if (name == "RTOInt")
if (name == "RT0int")
return new RT0Int(quadrature, faceQuadrature);
if (name == "RT0tri")
return new RT0tri(quadrature, faceQuadrature);
return new RT0Tri(quadrature, faceQuadrature);
if (name == "RT0quad")
return new RT0quad(quadrature, faceQuadrature);
return new RT0Quad(quadrature, faceQuadrature);
if (name == "RT0tet")
return new RT0tet(quadrature, faceQuadrature);
return new RT0Tet(quadrature, faceQuadrature);
if (name == "RT0hex")
return new RT0hex(quadrature, faceQuadrature);
Exit(name + " not implemented");
return NULL;
};
Shape *Get_Shape(const string &name, const string &q, const string &fq) {
......
......@@ -121,7 +121,7 @@ public:
Exit("Not implemented!");
return 0.0;
}
virtual VectorField LocalHessian2D(const Point &, int) const {
Exit("Not implemented!");
return zero;
......@@ -144,7 +144,7 @@ public:
VectorField LocalGradient(int q, int i) const {
return localGradient[q][i];
}
virtual VectorField LocalHessian2D(int q, int i) const {
Exit("Not implemented!");
return zero;
......
Supports Markdown
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