Changeset 16070


Ignore:
Timestamp:
09/04/13 15:05:48 (12 years ago)
Author:
utke
Message:

CHG update mumps include file following the model of the gsl include
file; pass a Parameters instance all the way to the solver so we can
access the adolc EDF structure; do the solver registration based on
configurations options - the function pointers are separate structure
members and can coexist.

Location:
issm/trunk-jpl/src/c
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp

    r14999 r16070  
    113113                /*initialize a placeholder to store solver pointers: {{{*/
    114114                GenericParam<Adolc_edf> *theAdolcEDF_p=new GenericParam<Adolc_edf>(AdolcParamEnum);
     115#ifdef _HAVE_GSL_
    115116                theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(EDF_for_solverx);
     117#endif
     118#ifdef _HAVE_MUMPS_
     119                theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p=reg_ext_fct(mumpsSolveEDF);
     120#endif
    116121                // to save some space:
    117122                // we know we won't use adolc inside of  the solver:
    118123                theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->nestedAdolc=false;
    119                 // the solution vector is just allocated and doesn't have a meaningfull prior value
     124                // the solution vector is just allocated and doesn't have a meaningful prior value
    120125                theAdolcEDF_p->GetParameterValue().myEDF_for_solverx_p->dp_y_priorRequired=false;
    121126                // the solver wrapper makes sure the matrix and the right hand side don't change
  • issm/trunk-jpl/src/c/toolkits/issm/IssmMpiDenseMat.h

    r15838 r16070  
    518518                        /*Let's try and use the MUMPS solver here: */
    519519                        #ifdef _HAVE_MUMPS_
    520                         MpiDenseMumpsSolve(/*output*/ uf->vector,uf->M,uf->m, /*stiffness matrix:*/ this->matrix,this->M,this->N,this->m, /*right hand side load vector: */ pf->vector,pf->M,pf->m);
     520                        MpiDenseMumpsSolve(/*output*/ uf->vector,uf->M,uf->m, /*stiffness matrix:*/ this->matrix,this->M,this->N,this->m, /*right hand side load vector: */ pf->vector,pf->M,pf->m,parameters);
    521521                        #else
    522522                        _error_("IssmMpiDenseMat solver requires MUMPS solver");
  • issm/trunk-jpl/src/c/toolkits/mumps/MpiDenseMumpsSolve.cpp

    r16068 r16070  
    1515#include "../../shared/io/Comm/IssmComm.h"
    1616#include "../mpi/issmmpi.h"
     17#include "./mumpsincludes.h"
    1718
    1819/*Mumps header files: */
     
    7374                int* jcn_loc,
    7475                IssmPDouble *a_loc,
    75                 IssmPDouble *rhs) {
     76                IssmPDouble *rhs,
     77                Parameters* /*unused here*/) {
    7678        /*Initialize mumps: {{{*/
    7779        DMUMPS_STRUC_C theMumpsStruc;
     
    105107                int* jcn_loc,
    106108                IssmDouble *a_loc,
    107                 IssmDouble *rhs);
     109                IssmDouble *rhs,
     110                Parameters* parameters);
    108111#endif
    109112
    110 void MpiDenseMumpsSolve( /*output: */ IssmDouble* uf, int uf_M, int uf_m, /*matrix input: */ IssmDouble* Kff, int Kff_M, int Kff_N, int Kff_m, /*right hand side vector: */ IssmDouble* pf, int pf_M, int pf_m){ /*{{{*/
     113void MpiDenseMumpsSolve( /*output: */ IssmDouble* uf, int uf_M, int uf_m, /*matrix input: */ IssmDouble* Kff, int Kff_M, int Kff_N, int Kff_m, /*right hand side vector: */ IssmDouble* pf, int pf_M, int pf_m, Parameters* parameters){ /*{{{*/
    111114
    112115        /*Variables: {{{*/
     
    192195                   jcn_loc,
    193196                   a_loc,
    194                    rhs);
     197                   rhs,
     198                   parameters);
    195199
    196200if (my_rank==0) for (int i=0;i<Kff_M;++i) std::cout << i << " : " << rhs[i] << std::endl;
     
    240244                int* jcn_loc,
    241245                IssmDouble *a_loc,
    242                 IssmDouble *rhs) {
     246                IssmDouble *rhs,
     247                Parameters* parameters) {
    243248  int packedDimsSparseArrLength=1+1+1+local_nnz+local_nnz;
    244249  int *packedDimsSparseArr=xNew<int>(packedDimsSparseArrLength);
  • issm/trunk-jpl/src/c/toolkits/mumps/mumpsincludes.h

    r14864 r16070  
    66#define _MUMPS_INCLUDES_H_
    77
    8 void MpiDenseMumpsSolve(IssmDouble* uf,int uf_M,int uf_n, IssmDouble* Kff,int Kff_M, int Kff_N, int Kff_m, IssmDouble* pf, int pf_M, int pf_m);
     8/*{{{*/
     9#ifdef HAVE_CONFIG_H
     10        #include <config.h>
     11#else
     12#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
     13#endif
     14
     15#include "../../shared/Numerics/types.h"
     16/*}}}*/
     17
     18class Parameters;
     19
     20void MpiDenseMumpsSolve(IssmDouble* uf,int uf_M,int uf_n, IssmDouble* Kff,int Kff_M, int Kff_N, int Kff_m, IssmDouble* pf, int pf_M, int pf_m, Parameters* parameters);
     21
     22#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
     23// call back functions:
     24ADOLC_ext_fct_iArr mumpsSolveEDF;
     25ADOLC_ext_fct_iArr_fos_reverse fos_reverse_mumpsSolveEDF;
     26ADOLC_ext_fct_iArr_fov_reverse fov_reverse_mumpsSolveEDF;
     27#endif
    928
    1029#endif
Note: See TracChangeset for help on using the changeset viewer.