Ice Sheet System Model
4.18
Code documentation
src
c
bamg
BamgOpts.cpp
Go to the documentation of this file.
1
#include "
./bamgobjects.h
"
2
#include "../shared/shared.h"
3
4
/*Constructors/Destructors*/
5
BamgOpts::BamgOpts
(){
/*{{{*/
6
7
this->
anisomax
= 0;
8
this->
cutoff
= 0;
9
this->
coeff
= 0;
10
this->
errg
= 0;
11
this->
gradation
= 0;
12
this->
Hessiantype
= 0;
13
this->
maxnbv
= 0;
14
this->
maxsubdiv
= 0;
15
this->
Metrictype
= 0;
16
this->
nbjacobi
= 0;
17
this->
nbsmooth
= 0;
18
this->
omega
= 0;
19
this->
power
= 0;
20
this->
verbose
= 0;
21
22
this->
Crack
= 0;
23
this->
KeepVertices
= 0;
24
this->
splitcorners
= 0;
25
26
this->
hmin
= 0;
27
this->
hmax
= 0;
28
this->
hminVertices
=NULL; this->
hminVerticesSize
[0]=this->
hminVerticesSize
[1]=0;
29
this->
hmaxVertices
=NULL; this->
hmaxVerticesSize
[0]=this->
hmaxVerticesSize
[1]=0;
30
this->
hVertices
=NULL; this->
hVerticesLength
=0;
31
this->
metric
=NULL; this->
metricSize
[0]=this->
metricSize
[1]=0;
32
this->
field
=NULL; this->
fieldSize
[0]=this->
fieldSize
[1]=0;
33
this->
err
=NULL; this->
errSize
[0]=this->
errSize
[1]=0;
34
35
}
36
/*}}}*/
37
BamgOpts::~BamgOpts
(){
/*{{{*/
38
39
xDelete<double>(this->
hminVertices
);
40
xDelete<double>(this->
hmaxVertices
);
41
xDelete<double>(this->
hVertices
);
42
xDelete<double>(this->
metric
);
43
xDelete<double>(this->
field
);
44
xDelete<double>(this->
err
);
45
46
}
47
/*}}}*/
48
49
/*Methods*/
50
void
BamgOpts::Check
(
void
){
/*{{{*/
51
52
int
i;
53
54
if
(this->
anisomax
<1)
_error_
(
"'anisomax' option should be >=1"
);
55
if
(this->
coeff
==0)
_error_
(
"'coeff' should be positive"
);
56
if
(this->
errg
<0)
_error_
(
"'errg' option should be >0"
);
57
if
(this->
gradation
<1)
_error_
(
"'gradation' option should be >=1"
);
58
if
(this->
Hessiantype
!=0 && this->
Hessiantype
!=1)
_error_
(
"'Hessiantype' supported options are 0 and 1"
);
59
if
(this->
maxnbv
<3)
_error_
(
"'maxnbv' option should be >3"
);
60
if
(this->
maxsubdiv
<=1)
_error_
(
"'maxsubdiv' should be >1"
);
61
if
(this->
Metrictype
!=0 && this->
Metrictype
!=1 && this->
Metrictype
!=2)
_error_
(
"'Metrictype' supported options are 0, 1 and 2"
);
62
if
(this->
nbjacobi
<=0)
_error_
(
"'nbjacobi' option should be >0"
);
63
if
(this->
nbsmooth
<=0)
_error_
(
"'nbsmooth' option should be >0"
);
64
65
if
(this->
Crack
!=0 && this->
Crack
!=1)
_error_
(
"'Crack' supported options are 0 and 1"
);
66
if
(this->
KeepVertices
!=0 && this->
KeepVertices
!=1)
_error_
(
"'KeepVertices' supported options are 0 and 1"
);
67
68
if
(this->
hmin
<=0)
_error_
(
"'hmin' option should be >0"
);
69
if
(this->hmax<=0 || this->hmax<this->
hmin
)
_error_
(
"'hmax' option should be between 0 and hmin="
<< this->hmin);
70
if
(this->
hminVertices
&& this->
hminVerticesSize
[1]!=1)
_error_
(
"'hminVertices' should be a column"
);
71
if
(this->
hmaxVertices
&& this->
hmaxVerticesSize
[1]!=1)
_error_
(
"'hmaxVertices' should be a column"
);
72
if
(this->
hVertices
&& this->
hVerticesLength
<2)
_error_
(
"'hVertices' should be a vector"
);
73
if
(this->
metric
&& (this->
metricSize
[1]!=1 && this->
metricSize
[1]!=3))
_error_
(
"'metric' should have either 1 (iso) or 3 (aniso) columns."
);
74
if
(this->
field
){
75
if
(this->
errSize
[0]!=1 || this->
errSize
[1]!=this->
fieldSize
[1])
_error_
(
"'err' should be of size "
<< 1 <<
" x "
<< this->
fieldSize
[1]);
76
for
(i=0;i<this->
fieldSize
[1];i++) {
if
(this->
err
[i]<=0)
_error_
(
"'err' option should be >0"
);};
77
}
78
79
}
80
/*}}}*/
BamgOpts::cutoff
double cutoff
Definition:
BamgOpts.h:14
BamgOpts::power
double power
Definition:
BamgOpts.h:25
BamgOpts::err
double * err
Definition:
BamgOpts.h:47
BamgOpts::maxsubdiv
double maxsubdiv
Definition:
BamgOpts.h:20
BamgOpts::verbose
int verbose
Definition:
BamgOpts.h:26
BamgOpts::Crack
int Crack
Definition:
BamgOpts.h:29
BamgOpts::field
double * field
Definition:
BamgOpts.h:45
BamgOpts::Hessiantype
int Hessiantype
Definition:
BamgOpts.h:18
BamgOpts::coeff
double coeff
Definition:
BamgOpts.h:15
BamgOpts::nbjacobi
int nbjacobi
Definition:
BamgOpts.h:22
BamgOpts::omega
double omega
Definition:
BamgOpts.h:24
BamgOpts::metricSize
int metricSize[2]
Definition:
BamgOpts.h:42
BamgOpts::hVertices
double * hVertices
Definition:
BamgOpts.h:41
BamgOpts::KeepVertices
int KeepVertices
Definition:
BamgOpts.h:30
BamgOpts::gradation
double gradation
Definition:
BamgOpts.h:17
BamgOpts::nbsmooth
int nbsmooth
Definition:
BamgOpts.h:23
BamgOpts::fieldSize
int fieldSize[2]
Definition:
BamgOpts.h:44
BamgOpts::hmaxVerticesSize
int hmaxVerticesSize[2]
Definition:
BamgOpts.h:38
BamgOpts::BamgOpts
BamgOpts()
Definition:
BamgOpts.cpp:5
BamgOpts::hmaxVertices
double * hmaxVertices
Definition:
BamgOpts.h:39
BamgOpts::hmax
double hmax
Definition:
BamgOpts.h:35
BamgOpts::~BamgOpts
~BamgOpts()
Definition:
BamgOpts.cpp:37
BamgOpts::errSize
int errSize[2]
Definition:
BamgOpts.h:46
BamgOpts::splitcorners
int splitcorners
Definition:
BamgOpts.h:31
BamgOpts::maxnbv
int maxnbv
Definition:
BamgOpts.h:19
BamgOpts::metric
double * metric
Definition:
BamgOpts.h:43
_error_
#define _error_(StreamArgs)
Definition:
exceptions.h:49
BamgOpts::hmin
double hmin
Definition:
BamgOpts.h:34
BamgOpts::Check
void Check(void)
Definition:
BamgOpts.cpp:50
BamgOpts::errg
double errg
Definition:
BamgOpts.h:16
BamgOpts::hVerticesLength
int hVerticesLength
Definition:
BamgOpts.h:40
BamgOpts::anisomax
double anisomax
Definition:
BamgOpts.h:13
BamgOpts::Metrictype
int Metrictype
Definition:
BamgOpts.h:21
bamgobjects.h
BamgOpts::hminVerticesSize
int hminVerticesSize[2]
Definition:
BamgOpts.h:36
BamgOpts::hminVertices
double * hminVertices
Definition:
BamgOpts.h:37
Generated on Thu Jul 2 2020 08:09:16 for Ice Sheet System Model by
1.8.19