GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
N_parse_options.c
Go to the documentation of this file.
1 
2 /*****************************************************************************
3 *
4 * MODULE: Grass PDE Numerical Library
5 * AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006
6 * soerengebbert <at> gmx <dot> de
7 *
8 * PURPOSE: standard parser option for the numerical pde library
9 *
10 * COPYRIGHT: (C) 2000 by the GRASS Development Team
11 *
12 * This program is free software under the GNU General Public
13 * License (>=v2). Read the file COPYING that comes with GRASS
14 * for details.
15 *
16 *****************************************************************************/
17 
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 #include <grass/glocale.h>
22 #include <grass/N_pde.h>
23 
42 struct Option *N_define_standard_option(int opt)
43 {
44  struct Option *Opt;
45 
46  Opt = G_define_option();
47 
48  switch (opt) {
49  /*solver for symmetric, positive definite linear equation systems */
50  case N_OPT_SOLVER_SYMM:
51  Opt->key = "solver";
52  Opt->type = TYPE_STRING;
53  Opt->required = NO;
54  Opt->key_desc = "name";
55  Opt->answer = "cg";
56  Opt->guisection = "Solver";
57  Opt->options = "gauss,lu,cholesky,jacobi,sor,cg,bicgstab,pcg";
58  Opt->description =
59  _("The type of solver which should solve the symmetric linear equation system");
60  break;
61  /*solver for unsymmetric linear equation systems */
63  Opt->key = "solver";
64  Opt->type = TYPE_STRING;
65  Opt->required = NO;
66  Opt->key_desc = "name";
67  Opt->answer = "bicgstab";
68  Opt->guisection = "Solver";
69  Opt->options = "gauss,lu,jacobi,sor,bicgstab";
70  Opt->description =
71  _("The type of solver which should solve the linear equation system");
72  break;
74  Opt->key = "maxit";
75  Opt->type = TYPE_INTEGER;
76  Opt->required = NO;
77  Opt->answer = "100000";
78  Opt->guisection = "Solver";
79  Opt->description =
80  _("Maximum number of iteration used to solver the linear equation system");
81  break;
83  Opt->key = "error";
84  Opt->type = TYPE_DOUBLE;
85  Opt->required = NO;
86  Opt->answer = "0.0000000001";
87  Opt->guisection = "Solver";
88  Opt->description =
89  _("Error break criteria for iterative solvers (jacobi, sor, cg or bicgstab)");
90  break;
91  case N_OPT_SOR_VALUE:
92  Opt->key = "relax";
93  Opt->type = TYPE_DOUBLE;
94  Opt->required = NO;
95  Opt->answer = "1";
96  Opt->guisection = "Solver";
97  Opt->description =
98  _("The relaxation parameter used by the jacobi and sor solver for speedup or stabilizing");
99  break;
100  case N_OPT_CALC_TIME:
101  Opt->key = "dt";
102  Opt->type = TYPE_DOUBLE;
103  Opt->required = YES;
104  Opt->answer = "86400";
105  Opt->guisection = "Solver";
106  Opt->description = _("The calculation time in seconds");
107  break;
108  }
109 
110  return Opt;
111 }
struct Option * N_define_standard_option(int opt)
Create standardised Option structure related to the gpde library.
struct Option * G_define_option(void)
Initializes an Option struct.
Definition: parser.c:247