Changeset 434


Ignore:
Timestamp:
05/14/09 22:33:13 (16 years ago)
Author:
Eric.Larour
Message:

Finished new parallel solution sequence for all types of elements

Location:
issm/trunk/src/c
Files:
6 added
10 edited

Legend:

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

    r387 r434  
    7777                                        ./shared/Matrix/matrix.h\
    7878                                        ./shared/Matrix/MatrixUtils.cpp\
     79                                        ./shared/Dofs/dofs.h\
     80                                        ./shared/Dofs/dofsetgen.cpp\
    7981                                        ./shared/Numerics/numerics.h\
    8082                                        ./shared/Numerics/GaussPoints.h\
     
    125127                                        ./toolkits/petsc/patches/NewMat.cpp\
    126128                                        ./toolkits/petsc/patches/VecFree.cpp\
     129                                        ./toolkits/petsc/patches/VecDuplicatePatch.cpp\
    127130                                        ./toolkits/petsc/patches/KSPFree.cpp\
    128131                                        ./toolkits/petsc/patches/ISFree.cpp\
     
    320323                                        ./shared/Matrix/matrix.h\
    321324                                        ./shared/Matrix/MatrixUtils.cpp\
     325                                        ./shared/Dofs/dofs.h\
     326                                        ./shared/Dofs/dofsetgen.cpp\
    322327                                        ./shared/Numerics/numerics.h\
    323328                                        ./shared/Numerics/GaussPoints.h\
     
    368373                                        ./toolkits/petsc/patches/NewMat.cpp\
    369374                                        ./toolkits/petsc/patches/VecFree.cpp\
     375                                        ./toolkits/petsc/patches/VecDuplicatePatch.cpp\
    370376                                        ./toolkits/petsc/patches/KSPFree.cpp\
    371377                                        ./toolkits/petsc/patches/ISFree.cpp\
     
    488494                                        ./SlopeExtrudex/SlopeExtrudex.cpp\
    489495                                        ./SlopeExtrudex/SlopeExtrudex.h\
     496                                        ./parallel/diagnostic_core.cpp\
     497                                        ./parallel/diagnostic_core_linear.cpp\
    490498                                        ./parallel/diagnostic_core_nonlinear.cpp\
    491499                                        ./parallel/CreateFemModel.cpp\
  • issm/trunk/src/c/parallel/GradJCompute.cpp

    r61 r434  
    4646
    4747        _printf_("%s\n","      recover solution for this stiffness and right hand side:");
    48         diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,inputs,femmodel);
     48        diagnostic_core_nonlinear(&u_g,&K_ff0,&K_fs0,femmodel,inputs,analysis_type);
    4949        VecToMPISerial(&u_g_double,u_g); VecFree(&u_g);
    5050
  • issm/trunk/src/c/parallel/OutputDiagnostic.cpp

    r209 r434  
    1111#include "../objects/objects.h"
    1212
    13 void OutputDiagnostic(Vec u_g,Vec partition,char* filename,NodeSets* nodesets,char* analysis_type){
     13void OutputDiagnostic(Vec u_g,Vec p_g, FemModel* femmodels,char* filename){
    1414
    1515        int i;
     
    1919        FILE* fid=NULL;
    2020
     21        /*intermediary: */
     22        FemModel  femmodel;
     23        NodeSets* nodesets=NULL;
     24        Vec       partition=NULL;
     25        char*     analysis_type="diagnostic";
     26       
    2127        /* standard output: */
    2228        Vec partition_shifted=NULL;
    2329        double* serial_partition=NULL;
    24         int    analysis_size;
    2530
    2631        double* serial_ug=NULL;
     
    2833        int     gsize;
    2934        int     nods;
     35
     36        /*Recover diagnostic horiz femmodel: */
     37        femmodel=femmodels[0];
     38        partition=femmodel.partition;
     39        nodesets=femmodel.nodesets;
    3040
    3141        /*serialize outputs: */
  • issm/trunk/src/c/parallel/control.cpp

    r405 r434  
    2525        char* outputfilename=NULL;
    2626        char* lockname=NULL;
    27         char* analysis_type="control";
     27        int   analysis_type;
    2828
    2929        /*Intermediary: */
     
    7878       
    7979        _printf_("read and create finite element model:\n");
    80         CreateFemModel(&femmodel,fid,analysis_type);
     80        CreateFemModel(&femmodel,fid,"control");
    8181
    8282        /*Recover parameters used throughout the solution:*/
     
    9292        femmodel.parameters->FindParam((void*)&p_g,"p_g");
    9393        femmodel.parameters->FindParam((void*)&u_g_obs,"u_g_obs");
     94        femmodel.parameters->FindParam((void*)&analysis_type,"analysis_type");
    9495        gsize=femmodel.nodes->NumberOfDofs();
    9596
     
    155156                        inputs->Add(control_type,p_g,2,numberofnodes);
    156157                        inputs->Add("fit",fit[n]);
    157                         diagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,&femmodel);
     158                        diagnostic_core_nonlinear(&u_g,NULL,NULL,&femmodel,inputs,analysis_type);
    158159                        OutputControl(u_g,p_g,J,nsteps,femmodel.partition,outputfilename,femmodel.nodesets);
    159160                        _printf_("%s\n","      done.");
     
    174175        UpdateFromInputsx(femmodel.elements,femmodel.nodes,femmodel.loads, femmodel.materials,inputs);
    175176       
    176         diagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,&femmodel);
     177        diagnostic_core_nonlinear(&u_g,NULL,NULL,&femmodel,inputs,analysis_type);
    177178       
    178179        _printf_("%s\n","      saving final results...");
  • issm/trunk/src/c/parallel/diagnostic.cpp

    r358 r434  
    2323        char* outputfilename=NULL;
    2424        char* lockname=NULL;
    25         char* analysis_type="diagnostic_horiz";
    2625        int   numberofnodes;
    2726
    28         /*Intermediary: */
    29         FemModel femmodel;
     27        /*Fem models : */
     28        FemModel femmodels[5];
     29       
    3030        Vec u_g=NULL;
     31        Vec p_g=NULL;
    3132        ParameterInputs* inputs=NULL;
    3233        int waitonlock=0;
     
    5758
    5859        _printf_("read and create finite element model:\n");
    59         CreateFemModel(&femmodel,fid,analysis_type);
     60        CreateFemModel(&femmodels[0],fid,"diagnostic_horiz");
     61        CreateFemModel(&femmodels[1],fid,"diagnostic_vert");
     62        CreateFemModel(&femmodels[2],fid,"diagnostic_stokes");
     63        CreateFemModel(&femmodels[3],fid,"diagnostic_hutter");
     64        CreateFemModel(&femmodels[4],fid,"slope_compute");
    6065
    6166        _printf_("initialize inputs:\n");
    62         femmodel.parameters->FindParam((void*)&u_g_initial,"u_g");
    63         femmodel.parameters->FindParam((void*)&numberofnodes,"numberofnodes");
     67        femmodels[0].parameters->FindParam((void*)&u_g_initial,"u_g");
     68        femmodels[0].parameters->FindParam((void*)&numberofnodes,"numberofnodes");
    6469
    6570        inputs=new ParameterInputs;
    6671        inputs->Add("velocity",u_g_initial,3,numberofnodes);
    6772
    68         param=(Param*)femmodel.parameters->FindParamObject("u_g");
    69         femmodel.parameters->DeleteObject((Object*)param);
     73        /*erase velocities: */
     74        param=(Param*)femmodels[0].parameters->FindParamObject("u_g");
     75        femmodels[0].parameters->DeleteObject((Object*)param);
    7076
    7177        _printf_("call computational core:\n");
    72         diagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,&femmodel);
     78        diagnostic_core(&u_g,&p_g,femmodels,inputs);
    7379
    7480        _printf_("write results to disk:\n");
    75         OutputDiagnostic(u_g,femmodel.partition,outputfilename,femmodel.nodesets,analysis_type);
     81        OutputDiagnostic(u_g,p_g,&femmodels[0],outputfilename);
    7682
    7783        _printf_("write lock file:\n");
    78         femmodel.parameters->FindParam((void*)&waitonlock,"waitonlock");
     84        femmodels[0].parameters->FindParam((void*)&waitonlock,"waitonlock");
    7985        if (waitonlock){
    8086                WriteLockFile(lockname);
  • issm/trunk/src/c/parallel/diagnostic_core_nonlinear.cpp

    r369 r434  
    1111#include "../issm.h"
    1212
    13 void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, ParameterInputs* inputs,FemModel* fem){
     13void diagnostic_core_nonlinear(Vec* pug,Mat* pKff0,Mat* pKfs0, FemModel* fem,ParameterInputs* inputs,int analysis_type){
    1414
    1515
     
    3838        /*parameters:*/
    3939        int kflag,pflag,connectivity,numberofdofspernode;
    40         int analysis_type;
    4140        char* solver_string=NULL;
    4241        int debug=0;
     
    5554        fem->parameters->FindParam((void*)&yts,"yts");
    5655        fem->parameters->FindParam((void*)&debug,"debug");
    57         fem->parameters->FindParam((void*)&analysis_type,"analysis_type");
    5856
    5957        /*Copy loads for backup: */
  • issm/trunk/src/c/parallel/objectivefunctionC.cpp

    r246 r434  
    7575
    7676        //Run diagnostic with updated parameters.
    77         diagnostic_core_nonlinear(&u_g,NULL,NULL,inputs,femmodel);
     77        diagnostic_core_nonlinear(&u_g,NULL,NULL,femmodel,inputs,analysis_type);
    7878        VecToMPISerial(&u_g_double,u_g); VecFree(&u_g);
    7979
  • issm/trunk/src/c/parallel/parallel.h

    r46 r434  
    77
    88#include "../objects/objects.h"
     9#include "../io/io.h"
    910
    1011Vec GradJCompute(ParameterInputs* inputs,FemModel* femmodel,double* u_g_obs);
    1112
    12 void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, ParameterInputs* inputs,FemModel* fem);
     13void diagnostic_core(Vec* pug, Vec* ppg,FemModel* fems, ParameterInputs* inputs);
     14void diagnostic_core_nonlinear(Vec* pug,Mat* pK_ff0,Mat* pK_fs0, FemModel* fem,ParameterInputs* inputs,int analysis_type);
     15void diagnostic_core_linear(Vec* ppg,FemModel* fem,ParameterInputs* inputs,int  analysis_type);
    1316int cielothermal_core(Vec** pt_g,ParameterInputs* inputs,FemModel* femmodel);
    1417
     
    2528
    2629//int ParameterUpdate(double* search_vector,int step, WorkspaceParams* workspaceparams,BatchParams* batchparams);
    27 void OutputDiagnostic(Vec u_g,Vec tpartition,char* filename,NodeSets* nodesets,char* analysis_type);
     30void OutputDiagnostic(Vec u_g,Vec p_g, FemModel* femmodels,char* filename);
    2831int OutputThermal(Vec* t_g,Vec* tpartition,char* filename,char* analysis_type);
    2932void OutputControl(Vec u_g,double* p_g, double* J, int nsteps, Vec partition,char* filename,NodeSets* nodesets);
  • issm/trunk/src/c/shared/shared.h

    r1 r434  
    1616#include "Matrix/matrix.h"
    1717#include "Numerics/numerics.h"
     18#include "Dofs/dofs.h"
    1819
    1920
  • issm/trunk/src/c/toolkits/petsc/patches/petscpatches.h

    r1 r434  
    4141void MatMultPatch(Mat A,Vec X, Vec AX);
    4242void MatToSerial(double** poutmatrix,Mat matrix);
     43void VecDuplicatePatch(Vec* output, Vec input);
    4344
    4445
Note: See TracChangeset for help on using the changeset viewer.