GRASS Programmer's Manual
6.4.2(2012)
|
00001 00002 /***************************************************************************** 00003 * 00004 * MODULE: Grass PDE Numerical Library 00005 * AUTHOR(S): Soeren Gebbert, Berlin (GER) Dec 2006 00006 * soerengebbert <at> gmx <dot> de 00007 * 00008 * PURPOSE: standard parser option for the numerical pde library 00009 * 00010 * COPYRIGHT: (C) 2000 by the GRASS Development Team 00011 * 00012 * This program is free software under the GNU General Public 00013 * License (>=v2). Read the file COPYING that comes with GRASS 00014 * for details. 00015 * 00016 *****************************************************************************/ 00017 00018 #include <stdio.h> 00019 #include <stdlib.h> 00020 #include <string.h> 00021 #include <grass/glocale.h> 00022 #include <grass/N_pde.h> 00023 00042 struct Option *N_define_standard_option(int opt) 00043 { 00044 struct Option *Opt; 00045 00046 Opt = G_define_option(); 00047 00048 switch (opt) { 00049 /*solver for symmetric, positive definite linear equation systems */ 00050 case N_OPT_SOLVER_SYMM: 00051 Opt->key = "solver"; 00052 Opt->type = TYPE_STRING; 00053 Opt->required = NO; 00054 Opt->key_desc = "name"; 00055 Opt->answer = "cg"; 00056 Opt->guisection = "Solver"; 00057 Opt->options = "gauss,lu,cholesky,jacobi,sor,cg,bicgstab,pcg"; 00058 Opt->description = 00059 _("The type of solver which should solve the symmetric linear equation system"); 00060 break; 00061 /*solver for unsymmetric linear equation systems */ 00062 case N_OPT_SOLVER_UNSYMM: 00063 Opt->key = "solver"; 00064 Opt->type = TYPE_STRING; 00065 Opt->required = NO; 00066 Opt->key_desc = "name"; 00067 Opt->answer = "bicgstab"; 00068 Opt->guisection = "Solver"; 00069 Opt->options = "gauss,lu,jacobi,sor,bicgstab"; 00070 Opt->description = 00071 _("The type of solver which should solve the linear equation system"); 00072 break; 00073 case N_OPT_MAX_ITERATIONS: 00074 Opt->key = "maxit"; 00075 Opt->type = TYPE_INTEGER; 00076 Opt->required = NO; 00077 Opt->answer = "100000"; 00078 Opt->guisection = "Solver"; 00079 Opt->description = 00080 _("Maximum number of iteration used to solver the linear equation system"); 00081 break; 00082 case N_OPT_ITERATION_ERROR: 00083 Opt->key = "error"; 00084 Opt->type = TYPE_DOUBLE; 00085 Opt->required = NO; 00086 Opt->answer = "0.0000000001"; 00087 Opt->guisection = "Solver"; 00088 Opt->description = 00089 _("Error break criteria for iterative solvers (jacobi, sor, cg or bicgstab)"); 00090 break; 00091 case N_OPT_SOR_VALUE: 00092 Opt->key = "relax"; 00093 Opt->type = TYPE_DOUBLE; 00094 Opt->required = NO; 00095 Opt->answer = "1"; 00096 Opt->guisection = "Solver"; 00097 Opt->description = 00098 _("The relaxation parameter used by the jacobi and sor solver for speedup or stabilizing"); 00099 break; 00100 case N_OPT_CALC_TIME: 00101 Opt->key = "dt"; 00102 Opt->type = TYPE_DOUBLE; 00103 Opt->required = YES; 00104 Opt->answer = "86400"; 00105 Opt->guisection = "Solver"; 00106 Opt->description = _("The calculation time in seconds"); 00107 break; 00108 } 00109 00110 return Opt; 00111 }