Skip to content
Snippets Groups Projects
Commit 893ff293 authored by Ondřej Székely's avatar Ondřej Székely
Browse files

Temporary fixing tnlTriangleArea, fixing getElementMeasure.

parent f10eafb6
No related branches found
No related tags found
No related merge requests found
...@@ -453,4 +453,20 @@ Real tnlTriangleArea( const tnlStaticVector< 2, Real >& a, ...@@ -453,4 +453,20 @@ Real tnlTriangleArea( const tnlStaticVector< 2, Real >& a,
return 0.5 * sqrt( tnlScalarProduct( v, v ) ); return 0.5 * sqrt( tnlScalarProduct( v, v ) );
}; };
template< typename Real >
Real tnlTriangleArea( const tnlStaticVector< 3, Real >& a,
const tnlStaticVector< 3, Real >& b,
const tnlStaticVector< 3, Real >& c )
{
tnlStaticVector< 3, Real > u1, u2;
u1. x() = b. x() - a. x();
u1. y() = b. y() - a. y();
u1. z() = 0.0;
u2. x() = c. x() - a. x();
u2. y() = c. y() - a. y();
u2. z() = 0;
const tnlStaticVector< 3, Real > v = tnlVectorProduct( u1, u2 );
return 0.5 * sqrt( tnlScalarProduct( v, v ) );
};
#endif /* TNLSTATICVECTOR_H_ */ #endif /* TNLSTATICVECTOR_H_ */
...@@ -327,7 +327,7 @@ template< typename Real, ...@@ -327,7 +327,7 @@ template< typename Real,
void tnlIdenticalGridGeometry< 3, Real, Device, Index > :: setParametricStep( const VertexType& parametricStep ) void tnlIdenticalGridGeometry< 3, Real, Device, Index > :: setParametricStep( const VertexType& parametricStep )
{ {
this -> parametricStep = parametricStep; this -> parametricStep = parametricStep;
this -> elementMeasure = this -> parametricStep. x() * this -> parametricStep. y(); this -> elementMeasure = this -> parametricStep. x() * this -> parametricStep. y()* this -> parametricStep. z();
} }
template< typename Real, template< typename Real,
......
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