Changeset 4002


Ignore:
Timestamp:
06/02/10 17:42:51 (15 years ago)
Author:
Eric.Larour
Message:

Added new Verticesdof and NodesDof modules. Deleted Dof module. Created new counters for loads and constraints. Presorting grouped together. Update of counters. CreateDataSets simplified.

Location:
issm/trunk/src
Files:
14 added
2 deleted
24 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/DataSet/DataSet.cpp

    r3971 r4002  
    872872}
    873873/*}}}*/
    874 /*FUNCTION DataSet::NumberOfDofs{{{1*/
    875 int   DataSet::NumberOfDofs(){
     874/*FUNCTION DataSet::NumberOfDofs(int analysis_type){{{1*/
     875int   DataSet::NumberOfDofs(int analysis_type){
    876876
    877877
     
    889889                        node=(Node*)(*object);
    890890
    891                         /*Ok, this object is a node, ask it to plug values into partition: */
    892                         if (!node->IsClone()){
    893 
    894                                 numdofs+=node->GetNumberOfDofs();
    895 
     891                        if (node->InAnalysis(analysis_type)){
     892
     893                                /*Ok, this object is a node, ask it to plug values into partition: */
     894                                if (!node->IsClone()){
     895
     896                                        numdofs+=node->GetNumberOfDofs();
     897
     898                                }
    896899                        }
    897900                }
     
    10401043/*}}}*/
    10411044/*FUNCTION DataSet::SetupSpcs{{{1*/
    1042 void   DataSet::SetupSpcs(DataSet* nodes,Vec yg){
     1045void   DataSet::SetupSpcs(DataSet* nodes,Vec yg,int analysis_type){
    10431046
    10441047        vector<Object*>::iterator object;
  • issm/trunk/src/c/DataSet/DataSet.h

    r3971 r4002  
    5757                void  DistributeNumDofs(int** pnumdofspernode,int numberofnodes,int analysis_type,int sub_analysis_type);
    5858                void  FlagClones(int numberofnodes);
    59                 int   NumberOfDofs();
     59                int   NumberOfDofs(int analysis_type);
    6060                int   NumberOfRgbs();
    61                 void  SetupSpcs(DataSet* nodes,Vec yg);
     61                void  SetupSpcs(DataSet* nodes,Vec yg,int analysis_type);
    6262                void  SetupMpcs(Mat Rmg,DataSet* nodes);
    6363                void  FlagNodeSets(Vec pv_g, Vec pv_m, Vec pv_n, Vec pv_f, Vec pv_s);
  • issm/trunk/src/c/Makefile.am

    r3985 r4002  
    300300                                        ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
    301301                                        ./modules/ModelProcessorx/NodesPartitioning.cpp
     302                                        ./modules/ModelProcessorx/SortDataSets.cpp\
     303                                        ./modules/ModelProcessorx/UpdateCounter.cpp\
    302304                                        ./modules/ModelProcessorx/CreateDataSets.cpp\
    303305                                        ./modules/ModelProcessorx/CreateParameters.cpp\
     
    355357                                        ./modules/ModelProcessorx/Balancedvelocities/CreateLoadsBalancedvelocities.cpp\
    356358                                        ./modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp\
    357                                         ./modules/Dofx/Dofx.h\
    358                                         ./modules/Dofx/Dofx.cpp\
     359                                        ./modules/VerticesDofx/VerticesDofx.h\
     360                                        ./modules/VerticesDofx/VerticesDofx.cpp\
     361                                        ./modules/NodesDofx/NodesDofx.h\
     362                                        ./modules/NodesDofx/NodesDofx.cpp\
    359363                                        ./modules/Dux/Dux.h\
    360364                                        ./modules/Dux/Dux.cpp\
     
    765769                                        ./modules/ModelProcessorx/NodesPartitioning.cpp
    766770                                        ./modules/ModelProcessorx/Partitioning.cpp\
     771                                        ./modules/ModelProcessorx/SortDataSets.cpp\
     772                                        ./modules/ModelProcessorx/UpdateCounter.cpp\
    767773                                        ./modules/ModelProcessorx/CreateDataSets.cpp\
    768774                                        ./modules/ModelProcessorx/CreateParameters.cpp\
     
    807813                                        ./modules/ModelProcessorx/Balancedvelocities/CreateLoadsBalancedvelocities.cpp\
    808814                                        ./modules/ModelProcessorx/Qmu/CreateParametersQmu.cpp\
    809                                         ./modules/Dofx/Dofx.h\
    810                                         ./modules/Dofx/Dofx.cpp\
     815                                        ./modules/VerticesDofx/VerticesDofx.h\
     816                                        ./modules/VerticesDofx/VerticesDofx.cpp\
     817                                        ./modules/NodesDofx/NodesDofx.h\
     818                                        ./modules/NodesDofx/NodesDofx.cpp\
    811819                                        ./modules/OutputResultsx/OutputResultsx.h\
    812820                                        ./modules/OutputResultsx/OutputResultsx.cpp\
  • issm/trunk/src/c/modules/ModelProcessorx/CreateDataSets.cpp

    r3984 r4002  
    117117        /*Generate objects that are not dependent on any analysis_type: */
    118118        CreateParameters(pparameters,iomodel,iomodel_handle);
    119         CreateParametersControl(pparameters,iomodel,iomodel_handle);
    120         CreateParametersQmu(pparameters,iomodel,iomodel_handle);
     119
     120        /*Sort datasets: */
     121        SortDataSets(elements,nodes,vertices, loads, materials, constraints, parameters);
     122
     123        /*Update counters, because we have created more nodes, loads and constraints, and ids for objects created in next call to CreateDataSets
     124         * will need to start at the end of the updated counters: */
     125        UpdateCounters(iomodel,pnodes,ploads,pconstraints);
     126
    121127}
  • issm/trunk/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp

    r3984 r4002  
    8888        xfree((void**)&iomodel->thickness);
    8989
    90         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    91          * datasets, it will not be redone: */
    92         elements->Presort();
    93         vertices->Presort();
    94         materials->Presort();
    95 
    9690        cleanup_and_return:
    9791       
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r3984 r4002  
    2121        char*    tag=NULL;
    2222        #ifdef _SERIAL_
    23                 mxArray* pfield=NULL;
    24                 mxArray* pfield2=NULL;
     23        mxArray* pfield=NULL;
     24        mxArray* pfield2=NULL;
    2525        #endif
    2626
     27        if(*pparameters)return; //do not create parameters twice!
     28               
    2729        /*Initialize dataset: */
    2830        parameters = new Parameters(ParametersEnum);
     
    103105        }
    104106
    105         /*All our datasets are already ordered by ids. Set presort flag so that later on, when sorting is requested on these
    106          * datasets, it will not be redone: */
    107         parameters->Presort();
    108 
     107       
    109108        /*Free data: */
    110109        xfree((void**)&tag);
     
    115114        xfree((void**)&parameteroutput);
    116115
     116
     117        /*Before returning, create parameters in case we are running Qmu or control types runs: */
     118        CreateParametersControl(&parameters,iomodel,iomodel_handle);
     119        CreateParametersQmu(&parameters,iomodel,iomodel_handle);
     120
    117121        /*Assign output pointer: */
    118122        *pparameters=parameters;
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp

    r3913 r4002  
    2323        int     node1,node2;
    2424
    25         /*Create constraints: */
    26         constraints = new DataSet(ConstraintsEnum);
     25        /*Recover pointer: */
     26        constraints=*pconstraints;
    2727
     28        /*Create constraints if they do not exist yet*/
     29        if(!constraints) constraints = new DataSet(ConstraintsEnum);
     30       
    2831        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
    2932        if (!iomodel->ismacayealpattyn)goto cleanup_and_return;
     
    3336        IoModelFetchData(&iomodel->gridonhutter,NULL,NULL,iomodel_handle,"gridonhutter");
    3437
    35         count=1; //matlab indexing
     38        /*Initialize counter: */
     39        count=0;
     40       
    3641        /*Create spcs from x,y,z, as well as the spc values on those spcs: */
    3742        for (i=0;i<iomodel->numberofvertices;i++){
     
    3944
    4045                        if ((int)iomodel->spcvelocity[6*i+0] | (int)iomodel->gridonhutter[i])
    41                                 constraints->AddObject(new Spc(count,i+1,1,*(iomodel->spcvelocity+6*i+3)/iomodel->yts)); //add count'th spc, on node i+1, setting dof 1 to vx.
     46                                constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,*(iomodel->spcvelocity+6*i+3)/iomodel->yts)); //add count'th spc, on node i+1, setting dof 1 to vx.
    4247
    4348                        count++;
    4449                       
    4550                        if ((int)iomodel->spcvelocity[6*i+1] | (int)iomodel->gridonhutter[i])
    46                                 constraints->AddObject(new Spc(count,i+1,2,*(iomodel->spcvelocity+6*i+4)/iomodel->yts)); //add count'th spc, on node i+1, setting dof 2 to vy
     51                                constraints->AddObject(new Spc(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,2,*(iomodel->spcvelocity+6*i+4)/iomodel->yts)); //add count'th spc, on node i+1, setting dof 2 to vy
    4752
    4853                        count++;
     
    5459        xfree((void**)&iomodel->gridonhutter);
    5560
    56        
    5761        /*penalty loads: */
    5862        IoModelFetchData(&iomodel->penalties,&iomodel->numpenalties,NULL,iomodel_handle,"penalties");
     
    6670       
    6771                                /*We are pairing nodes along a vertical profile.*/
    68                                 node1=(int)*(iomodel->penalties+iomodel->numlayers*i);
    69                                 node2=(int)*(iomodel->penalties+iomodel->numlayers*i+j);
     72                                node1=(int)*(iomodel->penalties+iomodel->numlayers*i)+iomodel->nodecounter;
     73                                node2=(int)*(iomodel->penalties+iomodel->numlayers*i+j)+iomodel->nodecounter;
    7074
    71                                 constraints->AddObject(new Rgb(count,node1,node2,1));  //add count'th Rgb on dof 1 between node1 and node2
     75                                constraints->AddObject(new Rgb(iomodel->constraintcounter+count+1,node1,node2,1));  //add count'th Rgb on dof 1 between node1 and node2
    7276                               
    7377                                count++;
    7478                               
    75                                 constraints->AddObject(new Rgb(count,node1,node2,2));  //add count'th Rgb on dof 1 between node1 and node2
     79                                constraints->AddObject(new Rgb(iomodel->constraintcounter+count+1,node1,node2,2));  //add count'th Rgb on dof 1 between node1 and node2
    7680
    7781                        }
     
    8286        xfree((void**)&iomodel->penalties);
    8387
    84         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    85          * datasets, it will not be redone: */
    86         constraints->Presort();
    87        
    8888        cleanup_and_return:
     89
    8990        /*Assign output pointer: */
    9091        *pconstraints=constraints;
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateLoadsDiagnosticHoriz.cpp

    r3984 r4002  
    2020        int element;
    2121        int i;
    22         int counter=1;
     22        int count=0;
    2323
    24         /*Create loads: */
    25         loads   = new DataSet(LoadsEnum);
     24        /*Recover pointer: */
     25        loads=*ploads;
     26
     27        /*Create loads if they do not exist yet*/
     28        if(!loads) loads = new DataSet(LoadsEnum);
    2629
    2730        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
     
    3437        IoModelFetchData(&iomodel->thickness,NULL,NULL,iomodel_handle,"thickness");
    3538        IoModelFetchData(&iomodel->bed,NULL,NULL,iomodel_handle,"bed");
     39
     40        /*Initialize counter: */
     41        count=0;
    3642
    3743        /*First load data:*/
     
    5056
    5157                /*Create and  add load: */
    52                 loads->AddObject(new Icefront(counter,i,iomodel));
    53                 counter++;
     58                loads->AddObject(new Icefront(iomodel->loadcounter+count+1,i,iomodel));
     59                count++;
    5460
    5561        }
     
    7379                        if(iomodel->my_elements[(int)*(iomodel->riftinfo+RIFTINFOSIZE*i+2)]){
    7480
    75                                 loads->AddObject(new Riftfront(counter,i,iomodel));
    76                                 counter++;
     81                                loads->AddObject(new Riftfront(iomodel->loadcounter+count+1,i,iomodel));
     82                                count++;
    7783                        }
    7884                }
     
    8894        cleanup_and_return:
    8995
    90         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    91          * datasets, it will not be redone: */
    92         loads->Presort();
    93 
    9496        /*Assign output pointer: */
    9597        *ploads=loads;
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp

    r3999 r4002  
    1717        /*Intermediary*/
    1818        int i;
    19         int totalnodes;
    2019        bool continuous_galerkin=true;
    2120
     
    2322        DataSet*    nodes = NULL;
    2423
    25         /*First create nodes*/
    26         nodes = new DataSet(NodesEnum);
     24        /*Recover pointer: */
     25        nodes=*pnodes;
     26
     27        /*Create nodes if they do not exist yet*/
     28        if(!nodes) nodes = new DataSet(NodesEnum);
    2729       
    2830        /*Now, is the flag macayaealpattyn on? otherwise, do nothing: */
    2931        if (!iomodel->ismacayealpattyn)goto cleanup_and_return;
    30 
    31         /*Recover number of nodes already created in other analyses: */
    32         totalnodes=iomodel->nodecounter;
    3332
    3433        /*Continuous Galerkin partition of nodes: */
     
    5150                       
    5251                        /*Add node to nodes dataset: */
    53                         nodes->AddObject(new Node(totalnodes+i+1,i,iomodel,DiagnosticHorizAnalysisEnum));
     52                        nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,iomodel,DiagnosticHorizAnalysisEnum));
    5453                }
    5554        }
    5655
    57         /*Increase nodecounter for other analyses to start their node indexing correctly: */
    58         totalnodes+=iomodel->numberofvertices;
    59         iomodel->nodecounter=totalnodes;
    60 
     56       
    6157        /*Clean fetched data: */
    6258        xfree((void**)&iomodel->gridonbed);
     
    6864        xfree((void**)&iomodel->uppernodes);
    6965
    70         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    71          * datasets, it will not be redone: */
    72         nodes->Presort();
    73 
    7466        /*Assign output pointer: */
    7567        *pnodes=nodes;
    76 
    7768}
  • issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r3984 r4002  
    101101void    CreateNumberNodeToElementConnectivity(IoModel* iomodel);
    102102
     103/*Diverse: */
     104void    SortDataSets(DataSet** pelements,DataSet** pnodes,DataSet** pvertices, DataSet** ploads, DataSet** pmaterials, DataSet** pconstraints, Parameters** pparameters);
     105void    UpdateCounter(IoModel* iomodel,DataSet** pnodes,DataSet** ploads, DataSet** pconstraints);
     106
     107
     108
    103109#endif
  • issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.cpp

    r4001 r4002  
    1010#include "../../EnumDefinitions/EnumDefinitions.h"
    1111
    12 void SpcNodesx(Vec* pyg, DataSet* nodes,DataSet* constraints){
     12void SpcNodesx(Vec* pyg, DataSet* nodes,DataSet* constraints,analysis_type){
    1313
    1414        int i;
     
    2020
    2121        /*First, recover number of dofs from nodes: */
    22         numberofdofs=nodes->NumberOfDofs();
     22        numberofdofs=nodes->NumberOfDofs(analysis_type);
    2323
    2424        if(numberofdofs){
  • issm/trunk/src/c/modules/SpcNodesx/SpcNodesx.h

    r4001 r4002  
    1111
    1212/* local prototypes: */
    13 void SpcNodesx(Vec* pyg, DataSet* nodesin,DataSet* constraints);
     13void SpcNodesx(Vec* pyg, DataSet* nodesin,DataSet* constraints,int analysis_type);
    1414
    1515#endif  /* _SPCNODESX_H */
  • issm/trunk/src/c/modules/modules.h

    r3938 r4002  
    88/*Modules: */
    99#include "./ModelProcessorx/ModelProcessorx.h"
    10 #include "./Dofx/Dofx.h"
     10#include "./NodesDofx/NodesDofx.h"
     11#include "./VerticesDofx/VerticesDofx.h"
    1112#include "./Dux/Dux.h"
    1213#include "./SpcNodesx/SpcNodesx.h"
  • issm/trunk/src/c/objects/FemModel.cpp

    r4001 r4002  
    124124
    125125        _printf_("   create degrees of freedom: \n");
    126         Dofx( &partition,&tpartition,elements,nodes, vertices,parameters);
     126        VerticesDofx( &partition,&tpartition,vertices,parameters);
     127        NodesDofx( nodes,parameters);
    127128       
    128129        _printf_("   create single point constraints: \n");
    129         SpcNodesx( &yg[analysis_counter], nodes,constraints);
     130        SpcNodesx( &yg[analysis_counter], nodes,constraints,analysis_type);
    130131       
    131132        _printf_("   create rigid body constraints:\n");
  • issm/trunk/src/c/objects/IoModel.cpp

    r3985 r4002  
    381381        this->numbernodetoelementconnectivity=NULL;
    382382        this->nodecounter=0;
     383        this->loadcounter=0;
     384        this->constraintcounter=0;
    383385}
    384386/*}}}*/
  • issm/trunk/src/c/objects/IoModel.h

    r3985 r4002  
    187187                int*    numbernodetoelementconnectivity;
    188188                int     nodecounter; //keep track of how many nodes are being created in each analysis type
     189                int     loadcounter; //keep track of how many loads are being created in each analysis type
     190                int     constraintcounter; //keep track of how many constraints are being created in each analysis type
    189191                /*}}}*/
    190192                /*Methods: {{{1*/
  • issm/trunk/src/c/objects/Node.cpp

    r3984 r4002  
    420420}
    421421/*}}}*/
     422/*FUNCTION Node::InAnalysis(int analysis_type){{{1*/
     423bool Node::InAnalysis(int in_analysis_type){
     424        if (in_analysis_type=this->analysis_type)return true;
     425        else return false;
     426}
    422427/*}}}*/
    423428/*Object numerics: {{{1*/
  • issm/trunk/src/c/objects/Node.h

    r3984 r4002  
    5959                void  UpdateInputsFromConstant(int constant, int name);
    6060                void  UpdateInputsFromConstant(bool constant, int name);
    61 
    6261                void  UpdateInputsFromSolution(double* solution, int analysis_type, int sub_analysis_type){ISSMERROR("Not implemented yet!");}
     62                bool  InAnalysis(int analysis_type);
    6363
    6464                /*}}}*/
  • issm/trunk/src/m/classes/@model/model.m

    r3994 r4002  
    102102        md.minh=0;
    103103        md.firn_layer=NaN;
    104         md.dof=NaN;
    105104
    106105        %Extraction
  • issm/trunk/src/m/solutions/jpl/CreateFemModel.m

    r3962 r4002  
    66%-----------------------------------------------------------------------
    77
    8 function  m=CreateFEMModel(md)
     8function  m=CreateFEMModel(md,analyses)
    99       
    1010        displaystring(md.verbose,'\n   reading data from model %s...',md.name);
    11         [m.elements,m.nodes,m.vertices,m.constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md);
     11        [m.elements,m.nodes,m.vertices,m.constraints,m.loads,m.materials,m.parameters]=ModelProcessor(md,analyses);
    1212
    13         displaystring(md.verbose,'%s','   generating degrees of freedom...');
    14         [m.nodes,m.vertices,m.part,m.tpart]=Dof(m.elements,m.nodes,m.vertices, m.parameters);
     13        for i=1:length(analyses),
    1514
    16         displaystring(md.verbose,'%s','   generating single point constraints...');
    17         [m.nodes,m.yg]=SpcNodes(m.nodes,m.constraints);
     15                displaystring(md.verbose,'%s','   generating degrees of freedom...');
     16                if ~isfield(m,'part') [m.vertices,m.part,m.tpart]=VerticesDof(vertices, m.parameters);
     17                [m.nodes]=NodesDof(m.nodes,m.parameters);
    1818
    19         displaystring(md.verbose,'%s','   generating rigid body constraints...');
    20         [m.Rmg,m.nodes]=MpcNodes(m.nodes,m.constraints);
     19                displaystring(md.verbose,'%s','   generating single point constraints...');
     20                [m.nodes,m.yg]=SpcNodes(m.nodes,m.constraints);
    2121
    22         displaystring(md.verbose,'%s','   generating node sets...');
    23         m.nodesets=BuildNodeSets(m.nodes);
     22                displaystring(md.verbose,'%s','   generating rigid body constraints...');
     23                [m.Rmg,m.nodes]=MpcNodes(m.nodes,m.constraints);
    2424
    25         displaystring(md.verbose,'%s','   reducing single point constraints vector...');
    26         m.ys=Reducevectorgtos(m.yg.vector,m.nodesets);
    27        
    28         displaystring(md.verbose,'%s','   normalizing rigid body constraints matrix...');
    29         m.Gmn = NormalizeConstraints(m.Rmg,m.nodesets);
     25                displaystring(md.verbose,'%s','   generating node sets...');
     26                m.nodesets=BuildNodeSets(m.nodes);
    3027
    31         displaystring(md.verbose,'%s','   configuring element and loads...');
    32         [m.elements,m.loads,m.nodes,m.parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.vertices,m.materials,m.parameters);
     28                displaystring(md.verbose,'%s','   reducing single point constraints vector...');
     29                m.ys=Reducevectorgtos(m.yg.vector,m.nodesets);
     30               
     31                displaystring(md.verbose,'%s','   normalizing rigid body constraints matrix...');
     32                m.Gmn = NormalizeConstraints(m.Rmg,m.nodesets);
    3333
    34         displaystring(md.verbose,'%s','   processing parameters...');
    35         m.parameters= ProcessParams(m.parameters,m.part.vector);
     34                displaystring(md.verbose,'%s','   configuring element and loads...');
     35                [m.elements,m.loads,m.nodes,m.parameters] = ConfigureObjects( m.elements, m.loads, m.nodes, m.vertices,m.materials,m.parameters);
     36
     37                displaystring(md.verbose,'%s','   processing parameters...');
     38                m.parameters= ProcessParams(m.parameters,m.part.vector);
     39        end
    3640
    3741end
  • issm/trunk/src/m/solutions/jpl/diagnostic.m

    r3934 r4002  
    88        t1=clock;
    99
    10         %Build all models requested for diagnostic simulation
    11         models.analysis_type=DiagnosticAnalysisEnum; %needed for processresults
     10        analyses=[DiagnosticHorizAnalysisEnum,DiagnosticVertAnalysisEnum,DiagnosticStokesAnalysisEnum,DiagnosticHutterAnalysisEnum,SlopecomputeAnalysisEnum];
    1211
    13         displaystring(md.verbose,'%s',['reading diagnostic horiz model data']);
    14         md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HorizAnalysisEnum; models.dh=CreateFemModel(md);
    15 
    16         displaystring(md.verbose,'\n%s',['reading diagnostic vert model data']);
    17         md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=VertAnalysisEnum; models.dv=CreateFemModel(md);
    18        
    19         displaystring(md.verbose,'\n%s',['reading diagnostic stokes model data']);
    20         md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=StokesAnalysisEnum; models.ds=CreateFemModel(md);
    21        
    22         displaystring(md.verbose,'\n%s',['reading diagnostic hutter model data']);
    23         md.analysis_type=DiagnosticAnalysisEnum; md.sub_analysis_type=HutterAnalysisEnum; models.dhu=CreateFemModel(md);
    24        
    25         displaystring(md.verbose,'\n%s',['reading surface and bed slope computation model data']);
    26         md.analysis_type=SlopecomputeAnalysisEnum; md.sub_analysis_type=NoneAnalysisEnum; models.sl=CreateFemModel(md);
    27        
    28         % figure out number of dof: just for information purposes.
    29         md.dof=modelsize(models);
     12        displaystring(md.verbose,'%s',['create fem model']);
     13        femmodel=CreateFemModel(md,analyses);
    3014
    3115        %compute solution
    32         if ~models.dh.parameters.QmuAnalysis,
    33                 if md.control_analysis,
     16        if ~femmodel.parameters.QmuAnalysis,
     17                if femodel.parameters.control_analysis,
     18                       
    3419                        %launch core of control solution.
    35                         results=control_core(models);
     20                        md.results.DiagnosticAnalysis=control_core(femmodel);
    3621
    37                         %process results
    38                         if ~isstruct(md.results), md.results=struct(); end
    39                         md.results.DiagnosticAnalysis=processresults(models,results);
    4022                else,
     23                       
    4124                        %launch core of diagnostic solution.
    42                         results=diagnostic_core(models);
     25                        md.results.DiagnosticAnalysis=diagnostic_core(femmodel);
    4326
    44                         %process results
    45                         if ~isstruct(md.results), md.results=struct(); end
    46                         md.results.DiagnosticAnalysis=processresults(models,results);
    4727                end
    4828        else
    4929                %launch dakota driver for diagnostic core solution
    50                 Qmu(models,models.dh.parameters);
     30                Qmu(femmodel);
    5131        end
    5232
  • issm/trunk/src/mex/Makefile.am

    r3883 r4002  
    1818                                CostFunction \
    1919                                DepthAverageInput\
    20                                 Dof\
     20                                NodesDof\
     21                                VerticesDof\
    2122                                Du\
    2223                                Echo\
     
    127128                          DepthAverageInput/DepthAverageInput.h
    128129
    129 Dof_SOURCES = Dof/Dof.cpp\
    130                           Dof/Dof.h
     130NodesDof_SOURCES = NodesDof/NodesDof.cpp\
     131                          NodesDof/NodesDof.h
     132
     133VerticesDof_SOURCES = VerticesDof/VerticesDof.cpp\
     134                          VerticesDof/VerticesDof.h
    131135
    132136Du_SOURCES = Du/Du.cpp\
  • issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp

    r3715 r4002  
    88void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
    99
    10         /*diverse: */
    11         int   noerr=1;
     10        int i;
     11
     12        /*inputs: */
     13        double* analyses=NULL;
     14        int     numanalyses;
    1215
    1316        /* output datasets: */
     
    3134        /*Fill iomodel with matlab workspace data: */
    3235        iomodel=new IoModel(MODEL); //this routine goes through the entire MODEL matlab class, and starts filling the corresponding "c" code model object.
     36        FetchData(&analyses,&numanalyses,ANALYSES);
    3337
    34         /*Create elements, nodes and materials: */
    35         CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints, &loads, &parameters, iomodel,MODEL);
     38        /*Create datasets, and update for each analysis type: */
     39        for(i=0;i<numanalyses;i++){
     40                CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints, &loads, &parameters, iomodel,MODEL,(int)analyses[i],numanalyses,i);
     41        }
    3642       
     43
    3744        /*Write output data: */
    3845        WriteData(ELEMENTS,elements);
     
    5461        delete materials;
    5562        delete parameters;
     63        delete analyses;
    5664
    5765        /*end module: */
     
    6169void ModelProcessorUsage(void) {
    6270        _printf_("\n");
    63         _printf_("   usage: [elements,grids,constraints,loads,materials,parameters,part,tpart]=ModelProcessor(model)\n");
    64         _printf_("   where: model is an instance of the matlab @model class.\n");
     71        _printf_("   usage: [elements,grids,constraints,loads,materials,parameters,part,tpart]=ModelProcessor(model,analyses)\n");
     72        _printf_("   where: model is an instance of the matlab @model class and analyses is a list of analysis types being performed.\n");
    6573        _printf_("\n");
    6674}
  • issm/trunk/src/mex/ModelProcessor/ModelProcessor.h

    r3913 r4002  
    2424/* serial input macros: */
    2525#define MODEL (mxArray*)prhs[0]
     26#define ANALYSES (mxArray*)prhs[1]
    2627
    2728/* serial output macros: */
     
    3839#define NLHS  7
    3940#undef NRHS
    40 #define NRHS  1
     41#define NRHS  2
    4142
    4243#endif  /* _MEXMODELPROCESSOR_H */
Note: See TracChangeset for help on using the changeset viewer.