source: issm/branches/trunk-jpl-damage/src/mex/ParsePetscOptions/ParsePetscOptions.cpp@ 12004

Last change on this file since 12004 was 12004, checked in by cborstad, 13 years ago

merged trunk-jpl into trunk-jpl-damage through revision 11990

File size: 1.2 KB
Line 
1/*\file ParsePetscOptions.c
2 *\brief: add petsc options to parameters
3 */
4
5#include "./ParsePetscOptions.h"
6
7void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
8
9 /*input datasets: */
10 Parameters *parameters = NULL;
11 char* petscoptionsfilename=NULL;
12 FILE* petscoptionsfid=NULL;
13
14 /*Boot module: */
15 MODULEBOOT();
16
17 /*checks on arguments on the matlab side: */
18 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ParsePetscOptionsUsage);
19
20 /*Input datasets: */
21 FetchData(&parameters,PARAMETERS);
22 FetchData(&petscoptionsfilename,PETSCOPTIONSFILENAME);
23
24 petscoptionsfid=fopen(petscoptionsfilename,"r");
25 if(petscoptionsfid==NULL)_error_("could not open petsc solver options file for reading\n");
26
27 ParsePetscOptionsx(parameters,petscoptionsfid);
28
29 /*write output datasets: */
30 WriteData(PARAMETERSOUT,parameters);
31
32 /*Free ressources: */
33 delete parameters;
34 xfree((void**)&petscoptionsfilename);
35 fclose(petscoptionsfid);
36
37 /*end module: */
38 MODULEEND();
39}
40
41void ParsePetscOptionsUsage(void)
42{
43 _printf_(true,"\n");
44 _printf_(true," usage: [parameters] = %s(parameters,petscoptionsfilename);\n",__FUNCT__);
45 _printf_(true,"\n");
46}
Note: See TracBrowser for help on using the repository browser.