Changeset 14633


Ignore:
Timestamp:
04/17/13 14:15:21 (12 years ago)
Author:
Eric.Larour
Message:

CHG: new ToolkitOptions static class variable, used to drive a lot of the Matrix, Vector and Solver
structures, akin to the Petsc Options database.

Location:
issm/trunk-jpl/src/c
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/Makefile.am

    r14632 r14633  
    6161                                        ./classes/IssmComm.h\
    6262                                        ./classes/IssmComm.cpp\
     63                                        ./classes/ToolkitOptions.h\
     64                                        ./classes/ToolkitOptions.cpp\
    6365                                        ./classes/Hook.h\
    6466                                        ./classes/Hook.cpp\
  • issm/trunk-jpl/src/c/classes/classes.h

    r13634 r14633  
    3232#include "./AdolcEdf.h"
    3333#include "./IssmComm.h"
     34#include "./ToolkitOptions.h"
    3435#include "./RiftStruct.h"
    3536
  • issm/trunk-jpl/src/c/include/globals.h

    r14292 r14633  
    33 */
    44
    5 #ifndef GLOBALS_H_
    6 #define GLOBALS_H_
     5#ifndef _GLOBALS_H_
     6#define _GLOBALS_H_
    77
    88#include "./types.h"
    99#include "../classes/IssmComm.h"
     10#include "../classes/ToolkitOptions.h"
    1011
     12/*Communicators: */
    1113COMM IssmComm::comm;
    1214bool IssmComm::parallel;
    1315
     16/*String that is used to characterize our toolkits, ends up in Petsc Options database if we use Petsc. Can also be used to characterize the ISSM toolkit, often used when Petsc is not allowed*/
     17char* ToolkitOptions::toolkitoptions;
     18
    1419#endif
  • issm/trunk-jpl/src/c/shared/Numerics/ToolkitsOptionsFromAnalysis.cpp

    r14632 r14633  
    11/*!\file:  ToolkitsOptionsFromAnalysis.cpp
    2  * \brief: this is mainly for the case where we run our toolkits using petsc. In this case, we need to
     2 * \brief: for each analysis, setup the issmoptions string.
     3 * This is mainly for the case where we run our toolkits using petsc. In this case, we need to
    34 * plug our toolkits options directly into the petsc options database. This is the case for each analysis type
    45 * and parameters
     
    1112#endif
    1213
    13 #include "../../classes/objects/objects.h"
     14#include "../../classes/classes.h"
    1415#include "../../Container/Parameters.h"
    1516#include "../../toolkits/toolkits.h"
     
    1718void ToolkitsOptionsFromAnalysis(Parameters* parameters,int analysis_type){
    1819
    19         /*intermediary: */
    2020        char* options=NULL;
    21 
     21       
    2222        /*Recover first the options string for this analysis: */
    2323        options=OptionsFromAnalysis(parameters,analysis_type);
    2424
    25         /*now, reset the petsc options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This
    26          *capability is not covered by Petsc!: */
     25        /*Initialize our Toolkit Options: */
     26        ToolkitOptions::Init(options);
    2727
    2828        #ifdef _HAVE_PETSC_
     29                /*In case we are using PETSC, we do not rely on issmoptions. Instead, we dump issmoptions into the Petsc
     30                 * options database: */
    2931
    30         #if _PETSC_MAJOR_ == 2
    31         PetscOptionsDestroy();
    32         PetscOptionsCreate();
    33         //PetscOptionsCheckInitial_Private();
    34         //PetscOptionsCheckInitial_Components();
    35         PetscOptionsSetFromOptions();
    36         PetscOptionsInsertMultipleString(options); //our patch
    37         #else
    38         PetscOptionsSetFromOptions();
    39         PetscOptionsClear();
    40         //PetscOptionsSetFromOptions();
    41         PetscOptionsInsertMultipleString(options); //our patch
    42         #endif
     32                #if _PETSC_MAJOR_ == 2
     33                PetscOptionsDestroy();
     34                PetscOptionsCreate();
     35                //PetscOptionsCheckInitial_Private();
     36                //PetscOptionsCheckInitial_Components();
     37                PetscOptionsSetFromOptions();
     38                PetscOptionsInsertMultipleString(options); //our patch
     39                #else
     40                PetscOptionsSetFromOptions();
     41                PetscOptionsClear();
     42                //PetscOptionsSetFromOptions();
     43                PetscOptionsInsertMultipleString(options); //our patch
     44                #endif
    4345
    4446        #endif
    45 
    46         /*Free ressources:*/
     47               
    4748        xDelete<char>(options);
    4849}
  • issm/trunk-jpl/src/c/toolkits/toolkits.h

    r13749 r14633  
    2727#include "./toolkitsenums.h"
    2828#include "./issm/issmtoolkit.h"
     29#include "../classes/ToolkitOptions.h"
    2930#endif
Note: See TracChangeset for help on using the changeset viewer.