# Changeset 1613 for XIOS/trunk/extern/remap/src/meshutil.cpp

Ignore:
Timestamp:
11/26/18 10:13:26 (3 years ago)
Message:

interpolation : increase conservation accurency when interpolate integrated flux on the cell. Same methode si now used to compute cell area and intersected cell area.

YM

File:
1 edited

Unmodified
Removed
• ## XIOS/trunk/extern/remap/src/meshutil.cpp

 r1581 #include "elt.hpp" #include "polyg.hpp" #include "intersection_ym.hpp" #include "earcut.hpp" #include namespace sphereRemap { using namespace std; double computePolygoneArea(Elt& a, const Coord &pole) { using N = uint32_t; using Point = array; vector vect_points; vector< vector > polyline; vector dstPolygon ; createGreatCirclePolygon(a, pole, dstPolygon) ; int na=dstPolygon.size() ; Coord *a_gno   = new Coord[na]; Coord OC=barycentre(a.vertex,a.n) ; Coord Oz=OC ; Coord Ox=crossprod(Coord(0,0,1),Oz) ; // choose Ox not too small to avoid rounding error if (norm(Ox)< 0.1) Ox=crossprod(Coord(0,1,0),Oz) ; Ox=Ox*(1./norm(Ox)) ; Coord Oy=crossprod(Oz,Ox) ; double cos_alpha; for(int n=0; n() ); vect_points[n][0] = a_gno[n].x; vect_points[n][1] = a_gno[n].y; } polyline.push_back(vect_points); vector indices_a_gno = mapbox::earcut(polyline); double area_a_gno=0 ; for(int i=0;i
Note: See TracChangeset for help on using the changeset viewer.