Last change
on this file since 13395 was 13395, checked in by Mathieu Morlighem, 12 years ago |
merged trunk-jpl and trunk for revision 13393
|
File size:
1.2 KB
|
Rev | Line | |
---|
[6014] | 1 | /*!\file: PetscOptionsFromAnalysis.cpp
|
---|
| 2 | * \brief: change petsc options using analysis type and parameters
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #ifdef HAVE_CONFIG_H
|
---|
[9320] | 6 | #include <config.h>
|
---|
[6014] | 7 | #else
|
---|
| 8 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
---|
| 9 | #endif
|
---|
| 10 |
|
---|
[13395] | 11 | #include "../../classes/objects/objects.h"
|
---|
[6014] | 12 | #include "../../Container/Parameters.h"
|
---|
| 13 | #include "../../toolkits/toolkits.h"
|
---|
| 14 |
|
---|
| 15 | void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){
|
---|
| 16 |
|
---|
[11995] | 17 | /*intermediary: */
|
---|
| 18 | char* options=NULL;
|
---|
[6014] | 19 |
|
---|
[11995] | 20 | /*Recover first the options string for this analysis: */
|
---|
| 21 | options=OptionsFromAnalysis(parameters,analysis_type);
|
---|
[6020] | 22 |
|
---|
[6014] | 23 | /*now, reset the options database with this string. Taken from petsc/install/src/sys/objects/pinit.c. This
|
---|
| 24 | *capability is not covered by Petsc!: */
|
---|
[6852] | 25 |
|
---|
[9826] | 26 | #if _PETSC_MAJOR_ == 2
|
---|
[6014] | 27 | PetscOptionsDestroy();
|
---|
| 28 | PetscOptionsCreate();
|
---|
| 29 | //PetscOptionsCheckInitial_Private();
|
---|
| 30 | //PetscOptionsCheckInitial_Components();
|
---|
| 31 | PetscOptionsSetFromOptions();
|
---|
[11995] | 32 | PetscOptionsInsertMultipleString(options); //our patch
|
---|
[6852] | 33 | #else
|
---|
| 34 | PetscOptionsSetFromOptions();
|
---|
| 35 | PetscOptionsClear();
|
---|
| 36 | //PetscOptionsSetFromOptions();
|
---|
[11995] | 37 | PetscOptionsInsertMultipleString(options); //our patch
|
---|
[6852] | 38 | #endif
|
---|
[6014] | 39 |
|
---|
[11995] | 40 | /*Free ressources:*/
|
---|
[12706] | 41 | xDelete<char>(options);
|
---|
[6014] | 42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.