|
Last change
on this file since 11995 was 11995, checked in by Mathieu Morlighem, 14 years ago |
|
merged trunk-jpl and trunk for revision 11994M
|
|
File size:
1.2 KB
|
| Line | |
|---|
| 1 | /*!\file: PetscOptionsFromAnalysis.cpp
|
|---|
| 2 | * \brief: change petsc options using analysis type and parameters
|
|---|
| 3 | */
|
|---|
| 4 |
|
|---|
| 5 | #ifdef HAVE_CONFIG_H
|
|---|
| 6 | #include <config.h>
|
|---|
| 7 | #else
|
|---|
| 8 | #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
|
|---|
| 9 | #endif
|
|---|
| 10 |
|
|---|
| 11 | #include "../../objects/objects.h"
|
|---|
| 12 | #include "../../Container/Parameters.h"
|
|---|
| 13 | #include "../../toolkits/toolkits.h"
|
|---|
| 14 |
|
|---|
| 15 | void PetscOptionsFromAnalysis(Parameters* parameters,int analysis_type){
|
|---|
| 16 |
|
|---|
| 17 | /*intermediary: */
|
|---|
| 18 | char* options=NULL;
|
|---|
| 19 |
|
|---|
| 20 | /*Recover first the options string for this analysis: */
|
|---|
| 21 | options=OptionsFromAnalysis(parameters,analysis_type);
|
|---|
| 22 |
|
|---|
| 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!: */
|
|---|
| 25 |
|
|---|
| 26 | #if _PETSC_MAJOR_ == 2
|
|---|
| 27 | PetscOptionsDestroy();
|
|---|
| 28 | PetscOptionsCreate();
|
|---|
| 29 | //PetscOptionsCheckInitial_Private();
|
|---|
| 30 | //PetscOptionsCheckInitial_Components();
|
|---|
| 31 | PetscOptionsSetFromOptions();
|
|---|
| 32 | PetscOptionsInsertMultipleString(options); //our patch
|
|---|
| 33 | #else
|
|---|
| 34 | PetscOptionsSetFromOptions();
|
|---|
| 35 | PetscOptionsClear();
|
|---|
| 36 | //PetscOptionsSetFromOptions();
|
|---|
| 37 | PetscOptionsInsertMultipleString(options); //our patch
|
|---|
| 38 | #endif
|
|---|
| 39 |
|
|---|
| 40 | /*Free ressources:*/
|
|---|
| 41 | xfree((void**)&options);
|
|---|
| 42 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.