[MOAB-dev] commit/MOAB: iulian07: linear tet constructor issue
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Mon Sep 23 13:36:30 CDT 2013
1 new commit in MOAB:
https://bitbucket.org/fathomteam/moab/commits/9a27bef6d8f4/
Changeset: 9a27bef6d8f4
Branch: Version4.6
User: iulian07
Date: 2013-09-23 20:34:50
Summary: linear tet constructor issue
backported on Version4.6; also add a smallish test
Affected #: 2 files
diff --git a/tools/mbcoupler/ElemUtil.hpp b/tools/mbcoupler/ElemUtil.hpp
index 597c264..2e31b64 100644
--- a/tools/mbcoupler/ElemUtil.hpp
+++ b/tools/mbcoupler/ElemUtil.hpp
@@ -168,7 +168,7 @@ namespace ElemUtil {
/**\brief Shape function space for a linear tetrahedron, obtained by a pushforward of the canonical affine shape functions. */
class LinearTet : public Map {
public:
- LinearTet(const std::vector<CartVect>& vertices) : Map(vertices){};
+ LinearTet(const std::vector<CartVect>& vertices) : Map(vertices){LinearTet::set_vertices(vertex);};
LinearTet();
/* Override the evaluation routines to take advantage of the properties of P1. */
virtual CartVect evaluate(const CartVect& xi) const {return this->vertex[0] + this->T*xi;};
diff --git a/tools/mbcoupler/ElementTest.cpp b/tools/mbcoupler/ElementTest.cpp
index 4f37602..19e9a2d 100644
--- a/tools/mbcoupler/ElementTest.cpp
+++ b/tools/mbcoupler/ElementTest.cpp
@@ -20,7 +20,20 @@ int main()
}
void test_tet() {
- moab::Element::LinearTet tet;
+ // test constructor on one simple tet
+ std::vector<CartVect> verts;
+ verts.push_back(CartVect(0.,0.,0.2));
+ verts.push_back(CartVect(1.1,0.,0.));
+ verts.push_back(CartVect(0.,1.13,0.));
+ verts.push_back(CartVect(0.,0.,1.));
+ moab::Element::LinearTet tet(verts);
+ CartVect p(0.25, 0.25, 0.25);
+ CartVect res = tet.ievaluate(p);
+ CartVect p1 = tet.evaluate(res);
+ double d = (p1-p).length_squared();
+ CHECK_REAL_EQUAL(0., d, 1.e-10);
+
+ return;
}// test_tet()
void test_hex() {
Repository URL: https://bitbucket.org/fathomteam/moab/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the moab-dev
mailing list