From 262607715dced9c01b742ac2127af65750a3be3b Mon Sep 17 00:00:00 2001
From: Samo Penic <samo.penic@gmail.com>
Date: Wed, 27 Jun 2012 14:53:51 +0000
Subject: [PATCH] Added program that calculates square spherical harmonics averages and stores them into file

---
 src/triangle.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/triangle.c b/src/triangle.c
index bcd074b..e051316 100644
--- a/src/triangle.c
+++ b/src/triangle.c
@@ -219,6 +219,18 @@
 	tria->xnorm=tria->xnorm/xden;
 	tria->ynorm=tria->ynorm/xden;
 	tria->znorm=tria->znorm/xden;	
+
+/*  Here it is an excellent point to recalculate volume of the triangle and
+ *  store it into datastructure. Volume is required at least by constant volume
+ *  calculation of vertex move and bondflip and spherical harmonics. */
+    tria->volume=(tria->vertex[0]->x+ tria->vertex[1]->x + tria->vertex[2]->x) * tria->xnorm + 
+       (tria->vertex[0]->y+ tria->vertex[1]->y + tria->vertex[2]->y) * tria->ynorm + 
+    (tria->vertex[0]->z+ tria->vertex[1]->z + tria->vertex[2]->z) * tria->znorm;
+    tria->volume=-xden*tria->volume/18.0;
+/*  Also, area can be calculated in each triangle */
+    tria->area=xden/2;
+
+
 	return TS_SUCCESS;
 }
 

--
Gitblit v1.9.3