Skip to content
Snippets Groups Projects
Commit 0b2ad995 authored by Oliver Sander's avatar Oliver Sander
Browse files

Method global() for dim=2 dimworld=3 implemented.

Not seriously tested yet, though.

[[Imported from SVN: r1788]]
parent 33c919ab
No related branches found
No related tags found
No related merge requests found
......@@ -185,8 +185,30 @@ template <class GridImp>
inline FieldVector<UGCtype, 3> UGGridGeometry<2,3,GridImp>::
global(const FieldVector<UGCtype, 2>& local) const
{
DUNE_THROW(GridError, "UGGridGeometry<2,3>::global not implemented yet!");
//return FieldVector<UGCtype, 3> dummy;
FieldVector<UGCtype, 3> result;
if (elementType_ == triangle) {
for (int i=0; i<3; i++)
result[i] = (1.0-local[0]-local[1])*coord_[0][i]
+ local[0]*coord_[1][i]
+ local[1]*coord_[2][i];
} else {
// quadrilateral
for (int i=0; i<3; i++)
result[i] = (1.0-local[0])*(1.0-local[1])*coord_[0][i]
+ local[0]*(1.0-local[1])*coord_[1][i]
+ local[0]*local[1]*coord_[2][i]
+ (1.0-local[0])*local[1]*coord_[3][i];
}
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment