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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.