 |
Ice Sheet System Model
4.18
Code documentation
|
Go to the documentation of this file.
7 #include "../shared/shared.h"
21 _printf_(
" integer coordinates i.x: " <<
i.
x <<
", i.y: " <<
i.
y <<
"\n");
22 _printf_(
" Euclidean coordinates r.x: " <<
r.
x <<
", r.y: " <<
r.
y <<
"\n");
38 double power=(bamgopts->
power);
39 double anisomax=(bamgopts->
anisomax);
40 double CutOff=bamgopts->
cutoff;
41 double hmin=(bamgopts->
hmin);
42 double hmax=(bamgopts->
hmax);
43 double coef=bamgopts->
coeff;
58 ci= 2.0/9.0 * 1/(err*coef*coef);
68 else if (Metrictype==1){
69 ci= 2.0/9.0 * 1/(err*coef*coef) * 1/
Max(
Abs(s), CutOff*(
Max(
Abs(smin),
Abs(smax))));
78 else if (Metrictype==2){
79 ci= 2.0/9.0 * 1/(err*coef*coef) * 1/(smax-smin);
82 _error_(
"Metrictype " << Metrictype <<
" not supported yet (use 0,1 or 2(default))");
86 Metric Miv(Hxx*ci,Hyx*ci,Hyy*ci);
95 if(power!=1.0) Vp.
pow(power);
133 R2 P(s->
r),PNew(0,0);
137 if (!tria->Hidden(j)){
142 PNew += Q+QP/
Max(lQP,1e-20);
145 ttc = tria->TriangleAdj(j);
146 jc =
NextEdge[tria->NuEdgeTriangleAdj(j)];
150 _error_(
"k>=2000 (Maximum number of iterations reached)");
152 }
while ( tbegin != tria);
154 PNew = PNew/(double)kk;
155 R2 Xmove((PNew-P)*omega);
172 double s = deta[0]+deta[1]+deta[2];
176 vP.
m =
Metric(aa,(*tstart)[0],(*tstart)[1],(*tstart)[2]);
193 double detold = tria->det;
194 tria->det =
bamg::det( (*tria)[0],(*tria)[1] ,(*tria)[2]);
196 if (tria->det<0) ok =1;
197 else if ( (
double)tria->det < detold/2 ) ok=1;
199 tria->SetUnMarkUnSwap(0);
200 tria->SetUnMarkUnSwap(1);
201 tria->SetUnMarkUnSwap(2);
202 ttc = tria->TriangleAdj(j);
203 jc =
NextEdge[tria->NuEdgeTriangleAdj(j)];
209 }
while ( tbegin != tria);
211 if (ok && loop) vP=vPsave;
void MetricFromHessian(const double Hxx, const double Hyx, const double Hyy, const double smin, const double smax, const double s, const double err, BamgOpts *bamgopts)
long Optim(short a, int=0)
#define _printf_(StreamArgs)
int GetReferenceNumber() const
double Smoothing(Mesh &, Mesh &, Triangle *&, double=1)
T Max(const T &a, const T &b)
long long det(const I2 &a, const I2 &b, const I2 &c)
void BoundAniso2(const double coef)
double LengthInterpole(const Metric &Ma, const Metric &Mb, R2 AB)
static const short EdgesVertexTriangle[3][2]
#define _error_(StreamArgs)
AdjacentTriangle CloseBoundaryEdge(I2 A, Triangle *t, double &a, double &b)
static const short VerticesOfTriangularEdge[3][2]
I2 R2ToI2(const R2 &P) const
RR Norme2_2(const P2< R, RR > x)
BamgVertex * EdgeVertex(const int &i) const
Triangle * TriangleFindFromCoord(const I2 &, long long[3], Triangle *tstart=0)
int IntersectWith(const Metric &M2)
static const short NextEdge[3]