Changeset 4063


Ignore:
Timestamp:
06/21/10 10:55:50 (15 years ago)
Author:
Eric.Larour
Message:

Renamed DuplicateInput to InputDuplicate

Location:
issm/trunk/src
Files:
5 added
1 deleted
23 edited

Legend:

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

    r4057 r4063  
    318318                                        ./EnumDefinitions/StringAsEnum.cpp\
    319319                                        ./modules/ModelProcessorx/ModelProcessorx.h\
     320                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
    320321                                        ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\
    321322                                        ./modules/ModelProcessorx/NodesPartitioning.cpp\
     
    405406                                        ./modules/MinVzx/MinVzx.h\
    406407                                        ./modules/MinVzx/MinVzx.cpp\
    407                                         ./modules/DuplicateInputx/DuplicateInputx.h\
    408                                         ./modules/DuplicateInputx/DuplicateInputx.cpp\
     408                                        ./modules/InputDuplicatex/InputDuplicatex.h\
     409                                        ./modules/InputDuplicatex/InputDuplicatex.cpp\
    409410                                        ./modules/ScaleInputx/ScaleInputx.h\
    410411                                        ./modules/ScaleInputx/ScaleInputx.cpp\
     
    836837                                        ./EnumDefinitions/StringAsEnum.cpp\
    837838                                        ./modules/ModelProcessorx/ModelProcessorx.h\
     839                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
    838840                                        ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\
    839841                                        ./modules/ModelProcessorx/NodesPartitioning.cpp\
     
    925927                                        ./modules/MinVzx/MinVzx.h\
    926928                                        ./modules/MinVzx/MinVzx.cpp\
    927                                         ./modules/DuplicateInputx/DuplicateInputx.h\
    928                                         ./modules/DuplicateInputx/DuplicateInputx.cpp\
     929                                        ./modules/InputDuplicatex/InputDuplicatex.h\
     930                                        ./modules/InputDuplicatex/InputDuplicatex.cpp\
    929931                                        ./modules/ScaleInputx/ScaleInputx.h\
    930932                                        ./modules/ScaleInputx/ScaleInputx.cpp\
  • issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r4034 r4063  
    1212class Parameters;
    1313#include "../../io/io.h"
     14
     15void ModelProcessorx(DataSet** pelements, DataSet** pnodes, DataSet** pvertices, DataSet** pmaterials, DataSet** pconstraints, DataSet** ploads, Parameters** pparameters, ConstDataHandle iomodel_handle,int solution_type,int nummodels, int* analysis_type_list);
    1416
    1517/*Creation of fem datasets: general drivers*/
  • issm/trunk/src/c/modules/VerticesDofx/VerticesDofx.cpp

    r4002 r4063  
    2525        DofVec* tpartition=NULL;
    2626
    27         if(*ppartition)return;
     27        if(*ppartition)return; //do not create partition vector twice! we only have on set of vertices
    2828
    2929        /*Initialize dofvecs: */
  • issm/trunk/src/c/modules/modules.h

    r4055 r4063  
    7878#include "./MaxVzx/MaxVzx.h"
    7979#include "./MaxAbsVzx/MaxAbsVzx.h"
    80 #include "./DuplicateInputx/DuplicateInputx.h"
     80#include "./InputDuplicatex/InputDuplicatex.h"
    8181#include "./ScaleInputx/ScaleInputx.h"
    8282#include "./AXPYInputx/AXPYInputx.h"
  • issm/trunk/src/c/objects/Elements/Beam.cpp

    r4057 r4063  
    980980}
    981981/*}}}*/
    982 /*FUNCTION Beam::DuplicateInput(int original_enum,int new_enum){{{1*/
    983 void  Beam::DuplicateInput(int original_enum,int new_enum){
     982/*FUNCTION Beam::InputDuplicate(int original_enum,int new_enum){{{1*/
     983void  Beam::InputDuplicate(int original_enum,int new_enum){
    984984
    985985        Input* original=NULL;
  • issm/trunk/src/c/objects/Elements/Beam.h

    r4057 r4063  
    9494                void  MaxVz(double* pmaxvz, bool process_units);
    9595                void  MaxAbsVz(double* pmaxabsvz, bool process_units);
    96                 void  DuplicateInput(int original_enum,int new_enum);
     96                void  InputDuplicate(int original_enum,int new_enum);
    9797                void  ScaleInput(int enum_type,double scale_factor);
    9898                void  AXPYInput(int YEnum, double scalar, int XEnum);
  • issm/trunk/src/c/objects/Elements/Element.h

    r4057 r4063  
    6464                virtual void   MaxVz(double* pmaxvz, bool process_units)=0;
    6565                virtual void   MaxAbsVz(double* pmaxabsvz, bool process_units)=0;
    66                 virtual void   DuplicateInput(int original_enum,int new_enum)=0;
     66                virtual void   InputDuplicate(int original_enum,int new_enum)=0;
    6767                virtual void   ScaleInput(int enum_type,double scale_factor)=0;
    6868                virtual void   GetVectorFromInputs(Vec vector,int NameEnum)=0;
  • issm/trunk/src/c/objects/Elements/Penta.cpp

    r4057 r4063  
    52335233}
    52345234/*}}}*/
    5235 /*FUNCTION Penta::DuplicateInput(int original_enum,int new_enum){{{1*/
    5236 void  Penta::DuplicateInput(int original_enum,int new_enum){
     5235/*FUNCTION Penta::InputDuplicate(int original_enum,int new_enum){{{1*/
     5236void  Penta::InputDuplicate(int original_enum,int new_enum){
    52375237
    52385238        Input* original=NULL;
  • issm/trunk/src/c/objects/Elements/Penta.h

    r4057 r4063  
    161161                void  MaxVz(double* pmaxvz, bool process_units);
    162162                void  MaxAbsVz(double* pmaxabsvz, bool process_units);
    163                 void  DuplicateInput(int original_enum,int new_enum);
     163                void  InputDuplicate(int original_enum,int new_enum);
    164164                void  ScaleInput(int enum_type,double scale_factor);
    165165                void  AXPYInput(int YEnum, double scalar, int XEnum);
  • issm/trunk/src/c/objects/Elements/Sing.cpp

    r4057 r4063  
    679679}
    680680/*}}}*/
    681 /*FUNCTION Sing::DuplicateInput(int original_enum,int new_enum){{{1*/
    682 void  Sing::DuplicateInput(int original_enum,int new_enum){
     681/*FUNCTION Sing::InputDuplicate(int original_enum,int new_enum){{{1*/
     682void  Sing::InputDuplicate(int original_enum,int new_enum){
    683683
    684684        Input* original=NULL;
  • issm/trunk/src/c/objects/Elements/Sing.h

    r4057 r4063  
    9393                void  MaxVz(double* pmaxvz, bool process_units);
    9494                void  MaxAbsVz(double* pmaxabsvz, bool process_units);
    95                 void  DuplicateInput(int original_enum,int new_enum);
     95                void  InputDuplicate(int original_enum,int new_enum);
    9696                void  ScaleInput(int enum_type,double scale_factor);
    9797                void  AXPYInput(int YEnum, double scalar, int XEnum);
  • issm/trunk/src/c/objects/Elements/Tria.cpp

    r4057 r4063  
    54125412}
    54135413/*}}}*/
    5414 /*FUNCTION Tria::DuplicateInput(int original_enum,int new_enum){{{1*/
    5415 void  Tria::DuplicateInput(int original_enum,int new_enum){
     5414/*FUNCTION Tria::InputDuplicate(int original_enum,int new_enum){{{1*/
     5415void  Tria::InputDuplicate(int original_enum,int new_enum){
    54165416
    54175417        Input* original=NULL;
  • issm/trunk/src/c/objects/Elements/Tria.h

    r4057 r4063  
    139139                void  MaxVz(double* pmaxvz, bool process_units);
    140140                void  MaxAbsVz(double* pmaxabsvz, bool process_units);
    141                 void  DuplicateInput(int original_enum,int new_enum);
     141                void  InputDuplicate(int original_enum,int new_enum);
    142142                void  ScaleInput(int enum_type,double scale_factor);
    143143                void  AXPYInput(int YEnum, double scalar, int XEnum);
  • issm/trunk/src/c/objects/FemModel.cpp

    r4059 r4063  
    3030        this->nummodels=nummodels;
    3131        this->solution_type=in_solution_type;
    32         analysis_counter=nummodels-1; //point to last analysis_type carried out.
     32        this->analysis_counter=nummodels-1; //point to last analysis_type carried out.
    3333        this->results=new DataSet(); //not initialized by CreateDataSets
    3434       
     
    4949        for(i=0;i<nummodels;i++)m_ys[i]=NULL;
    5050
    51         _printf_("   fill model with matlab workspace data\n");
    52         iomodel = new IoModel(IOMODEL);
     51        /*create datasets for all analyses: */
     52        ModelProcessorx(&this->elements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,this->solution_type,nummodels,analyses);
    5353
     54        /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */
    5455        for(i=0;i<nummodels;i++){
    5556
    5657                analysis_type=analysis_type_list[i];
    5758       
    58                 _printf_("   create datasets:\n");
    59                 CreateDataSets(&elements,&nodes,&vertices,&materials,&constraints,&loads,&parameters,iomodel,IOMODEL,solution_type,analysis_type,nummodels,i);
    60 
    6159                _printf_("   create degrees of freedom: \n");
    6260                VerticesDofx( &partition,&tpartition,vertices,parameters);
     
    8179                ConfigureObjectsx(elements, loads, nodes, vertices, materials,parameters);
    8280        }
    83 
    84         _printf_("   free ressources:\n");
    85         delete iomodel;
    8681}
    8782/*}}}1*/
  • issm/trunk/src/c/solutions/control_core.cpp

    r4055 r4063  
    9595               
    9696                _printf_("%s","      save new parameter...");
    97                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type,ControlParameterEnum);
     97                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,control_type,ControlParameterEnum);
    9898               
    9999                _printf_("%s%i%s%g\n","      value of misfit J after optimization #",n+1,": ",J[n]);
  • issm/trunk/src/c/solutions/diagnostic_core.cpp

    r4055 r4063  
    3636        /*for qmu analysis, reinitialize velocity so that fake sensitivities do not show up as a result of a different restart of the convergence at each trial.*/
    3737        if(qmu_analysis){
    38                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVxEnum,VxEnum);
    39                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVyEnum,VyEnum);
    40                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVzEnum,VzEnum);
    41                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuPressureEnum,PressureEnum);
     38                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVxEnum,VxEnum);
     39                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVyEnum,VyEnum);
     40                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuVzEnum,VzEnum);
     41                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,QmuPressureEnum,PressureEnum);
    4242        }
    4343
     
    7272
    7373                        //"recondition" pressure computed previously:
    74                         DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);
     74                        InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);
    7575                        ScaleInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureStokesEnum,1.0/stokesreconditioning);
    7676
  • issm/trunk/src/c/solutions/objectivefunctionC.cpp

    r4055 r4063  
    5454
    5555        /*Use ControlParameterEnum input to  reinitialize our input parameter: */
    56         DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ControlParameterEnum,control_type);
     56        InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,ControlParameterEnum,control_type);
    5757       
    5858        /*Use search scalar to shoot parameter in the gradient direction: */
  • issm/trunk/src/c/solutions/steadystate_core.cpp

    r4057 r4063  
    4343               
    4444                if(verbose)_printf_("%s\n","saving velocity, temperature and pressure to check for convergence at next step");
    45                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,VxOldEnum);
    46                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,VyOldEnum);
    47                 if(dim==3)DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum);
    48                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureOldEnum);
    49                 DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,TemperatureOldEnum);
     45                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum,VxOldEnum);
     46                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum,VyOldEnum);
     47                if(dim==3)InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VzEnum,VzOldEnum);
     48                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureOldEnum);
     49                InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,TemperatureEnum,TemperatureOldEnum);
    5050               
    5151                //increase counter
  • issm/trunk/src/c/solutions/stokescontrolinit.cpp

    r4055 r4063  
    4444
    4545        //recondition" pressure computed previously:
    46         DuplicateInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);
     46        InputDuplicatex(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);
    4747        ScaleInputx(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureStokesEnum,1.0/stokesreconditioning);
    4848
  • issm/trunk/src/m/solutions/jpl/diagnostic_core.m

    r3962 r4063  
    66%
    77
    8 %recover parameters common to all solutions
    9 verbose=model.dhu.parameters.Verbose;
    10 dim=model.dh.parameters.Dim;
    11 ishutter=model.dhu.parameters.IsHutter;
    12 ismacayealpattyn=model.dh.parameters.IsMacAyealPattyn;
    13 isstokes=model.ds.parameters.IsStokes;
    14 numrifts=model.dhu.parameters.NumRifts;
    15 qmu_analysis=model.dh.parameters.QmuAnalysis;
     8        %some parameters
     9        modify_loads=boolean(1);
     10        conserve_loads=boolean(1);
    1611
    17        
    18 %for qmu analysis, be sure the velocity input we are starting from  is the one in the parameters:
    19 if qmu_analysis,
    20         model=ModelUpdateInputsFromVector(model,m_dh.vx,VxEnum,VertexEnum);
    21         model=ModelUpdateInputsFromVector(model,m_dh.vy,VyEnum,VertexEnum);
    22         model=ModelUpdateInputsFromVector(model,m_dh.vz,VzEnum,VertexEnum);
    23 end
     12        %recover parameters common to all solutions
     13        verbose=femmodel.parameters.Verbose;
     14        dim=femmodel.parameters.Dim;
     15        ishutter=femmodel.parameters.IsHutter;
     16        ismacayealpattyn=femmodel.parameters.IsMacAyealPattyn;
     17        isstokes=femmodel.parameters.IsStokes;
     18        stokesreconditioning=femmodel.parameters.stokesreconditioning;
     19        qmu_analysis=femmodel.parameters.QmuAnalysis;
    2420
    25 %Compute slopes:
    26 [surfaceslopex,surfaceslopey]=slope_core(model.sl,SurfaceAnalysisEnum);
    27 [bedslopex,bedslopey]=slope_core(model.sl,BedAnalysisEnum);
    28 
    29 %Update:
    30 model=ModelUpdateInputsFromVector(model,surfaceslopex,SurfaceSlopexEnum,VertexEnum);
    31 model=ModelUpdateInputsFromVector(model,surfaceslopey,SurfaceSlopeyEnum,VertexEnum);
    32 model=ModelUpdateInputsFromVector(model,bedslopex,BedSlopexEnum,VertexEnum);
    33 model=ModelUpdateInputsFromVector(model,bedslopey,BedSlopeyEnum,VertexEnum);
    34 
    35 if ishutter,
    36 
    37         displaystring(verbose,'\n%s',['computing hutter velocities...']);
    38         u_g=diagnostic_core_linear(model.dhu,DiagnosticAnalysisEnum(),HutterAnalysisEnum());
    39 
    40         displaystring(verbose,'\n%s',['computing pressure according to MacAyeal...']);
    41         p_g=ComputePressure(model.dhu.elements,model.dhu.nodes,model.dhu.vertices,model.dhu.loads,model.dhu.materials,model.dhu.parameters,DiagnosticAnalysisEnum(),HutterAnalysisEnum());
    42 
    43         displaystring(verbose,'\n%s',['update boundary conditions for macyeal pattyn using hutter results...']);
    44         if ismacayealpattyn,
    45                 model.dh.y_g=u_g;
    46                 model.dh.ys=Reducevectorgtos(model.dh.y_g,model.dh.nodesets);
     21        %for qmu analysis, be sure the velocity input we are starting from  is the one in the parameters:
     22        if qmu_analysis,
     23                InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuVxEnum,VxEnum);
     24                InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuVyEnum,VyEnum);
     25                InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuVzEnum,VzEnum);
     26                InputDuplicate(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,QmuPressureEnum,PressureEnum);
    4727        end
    4828
    49 end
    50                
    51 if ismacayealpattyn,
     29        %Compute slopes:
     30        if(ishutter)surfaceslope_core(femmodel);end
     31        if(isstokes)bedslope_core(femmodel);end
    5232
    53         displaystring(verbose,'\n%s',['computing horizontal velocities...']);
    54         [u_g model.dh.loads]=diagnostic_core_nonlinear(model.dh,model.dh.loads,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     33        if ishutter,
    5534
    56         if dim==2,
    57                 displaystring(verbose,'\n%s',['computing pressure according to MacAyeal...']);
    58                 p_g=ComputePressure(model.dh.elements,model.dh.nodes,model.dh.vertices,model.dh.loads,model.dh.materials,model.dh.parameters,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     35                displaystring(verbose,'\n%s',['computing hutter velocities...']);
     36                femmodel=SetCurrentAnalysis(femmodel,DiagnosticHutterAnalysisEnum);
     37                femmodel=solver_linear(femmodel);
     38
     39                if(ismacayealpattyn)femmodel=ResetBoundaryConditions(femmodel,DiagnosticAnalysisEnum,HorizAnalysisEnum); end
     40
    5941        end
    60 end
     42                       
     43        if ismacayealpattyn,
     44
     45                displaystring(verbose,'\n%s',['computing horizontal velocities...']);
     46                femmodel=SetCurrentAnalysis(femmodel,DiagnosticHorizAnalysisEnum);
     47                femmodel=solver_diagnostic_nonlinear(femmodel,modify_loads);
     48        end
    6149       
    62 if dim==3,
    6350
    64         displaystring(verbose,'\n%s',['extruding horizontal velocities...']);
    65         u_g_horiz=FieldExtrude(model.dh.elements,model.dh.nodes,model.dh.vertices,model.dh.loads,model.dh.materials,model.dh.parameters,u_g,'velocity',1);
     51        if dim==3,
     52       
     53                displaystring(verbose,'\n%s',['computing vertical velocities...']);
     54                femmodel=SetCurrentAnalysis(femmodel,DiagnosticVertAnalysisEnum);
     55                femmodel=solver_linear(femmodel);
    6656
    67         [vx,vy]=SplitSolutionVector(u_g_horiz,model.dh.parameters.NumberOfNodes,model.dh.parameters.NumberOfDofsPerNode);
    68         model=ModelUpdateInputsFromVector(model,vx,VxEnum,VertexEnum);
    69         model=ModelUpdateInputsFromVector(model,vy,VyEnum,VertexEnum);
    70                
    71         displaystring(verbose,'\n%s',['computing vertical velocities...']);
    72         u_g_vert=diagnostic_core_linear(model.dv,DiagnosticAnalysisEnum(),VertAnalysisEnum());
    73         model=ModelUpdateInputsFromVector(model,u_g_vert,VzEnum,VertexEnum);
     57                if isstokes,
    7458
    75         displaystring(verbose,'\n%s',['computing pressure according to Pattyn...']);
    76         p_g=ComputePressure(model.dh.elements,model.dh.nodes,model.dh.vertices,model.dh.loads,model.dh.materials,model.dh.parameters,DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    77         model=ModelUpdateInputsFromVector(model,p_g,PressureEnum,VertexEnum);
    78         u_g=zeros(model.dh.parameters.NumberOfNodes*3,1); %%%%%%%%%%%%%%%%%%%%%%% NEED TO BE CLEANED
    79         u_g(1:3:end)=vx;
    80         u_g(2:3:end)=vy;
    81         u_g(3:3:end)=u_g_vert;
    82        
    83         if isstokes,
     59                        %"recondition" pressure computed previously:
     60                        InputDuplicate(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum,PressureStokesEnum);
     61                        ScaleInput(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureStokesEnum,1.0/stokesreconditioning);
    8462
    85                 %"recondition" pressure
    86                 p_g=p_g/m_ds.parameters.stokesreconditioning;
     63                        displaystring(verbose,'\n%s',['update boundary conditions for stokes using velocities previously computed...']);
     64                        femmodel=ResetBoundaryConditions(femmodel,DiagnosticAnalysisEnum,StokesAnalysisEnum);
    8765
    88                 displaystring(verbose,'\n%s',['update boundary conditions for stokes using velocities previously computed...']);
    89                 model.ds.y_g=zeros(model.ds.nodesets.gsize,1);
    90                 model.ds.y_g(dofsetgen([1,2],4,model.ds.nodesets.gsize))=u_g;
    91                 model.ds.y_g(dofsetgen([3],4,model.ds.nodesets.gsize))=u_g_vert;
    92                 model.ds.ys=Reducevectorgtos(model.ds.y_g,model.ds.nodesets);
     66                        displaystring(verbose,'\n%s',['computing stokes velocities and pressure...']);
     67                        femmodel=SetCurrentAnalysis(femmodel,DiagnosticStokesAnalysisEnum);
     68                        femmodel=solver_diagnostic_nonlinear(femmodel,conserve_loads);
     69                end
     70        end
    9371
    94                 displaystring(verbose,'\n%s',['computing stokes velocities and pressure ...']);
    95                 u_g=diagnostic_core_nonlinear(model.ds,DiagnosticAnalysisEnum(),StokesAnalysisEnum());
    96        
    97                 %"decondition" pressure
    98                 p_g=u_g(4:4:end)*model.dh.parameters.stokesreconditioning;
    99         end
    100 end
    101 %load onto results
    102 results.step=1;
    103 results.time=0;
    104 results.u_g=u_g;
    105 results.p_g=p_g;
    106 
    107 if numrifts,
    108         results.riftproperties=OutputRifts(model.dh.loads,model.dh.parameters);
    109 end
     72        displaystring(verbose,'\n%s',['saving results...']);
     73        InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum);
     74        InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VyEnum);
     75        InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,PressureEnum);
     76        if(dim==3) InputToResult(femmodel->elements,femmodel->nodes,femmodel->vertices,femmodel->loads,femmodel->materials,femmodel->parameters,VxEnum);
  • issm/trunk/src/mex/Makefile.am

    r4002 r4063  
    3030                                Gradj\
    3131                                HoleFiller \
     32                                InputDuplicate\
    3233                                InterpFromGridToMesh \
    3334                                InterpFromMeshToMesh2d \
     
    164165                          HoleFiller/HoleFiller.h
    165166
     167InputDuplicate_SOURCES = InputDuplicate/InputDuplicate.cpp\
     168                          InputDuplicate/InputDuplicate.h
     169
    166170InterpFromGridToMesh_SOURCES = InterpFromGridToMesh/InterpFromGridToMesh.cpp\
    167171                          InterpFromGridToMesh/InterpFromGridToMesh.h
  • issm/trunk/src/mex/ModelProcessor/ModelProcessor.cpp

    r4002 r4063  
    1111
    1212        /*inputs: */
    13         double* analyses=NULL;
     13        int     solution_type;
     14        double* double_analyses=NULL;
     15        int*    analyses=NULL;
    1416        int     numanalyses;
    1517
     
    2325        Parameters* parameters=NULL;
    2426
    25         /*input model: */
    26         IoModel* iomodel=NULL;
    27 
    2827        /*Boot module: */
    2928        MODULEBOOT();
     
    3231        CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&ModelProcessorUsage);
    3332
    34         /*Fill iomodel with matlab workspace data: */
    35         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);
     33        FetchData(&solution_type,SOLUTIONTYPE);
     34       
     35        FetchData(&double_analyses,&numanalyses,ANALYSES);
     36        analyses=(int*)xmalloc(numanalyses*sizeof(int));
     37        for(i=0;i<numanalyses;i++)analyses[i]=double_analyses[i];
    3738
    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         }
    42        
     39        /*call x code ModelProcessorx: */
     40        ModelProcessorx(&elements,&nodes,&vertices,&materials,&constraints, &loads, &parameters, MODEL,solution_type,numanalyses,analyses);
    4341
    4442        /*Write output data: */
     
    5351
    5452        /*Free ressources: */
    55         delete iomodel;
    5653        delete elements;
    5754        delete nodes;
     
    6158        delete materials;
    6259        delete parameters;
    63         delete analyses;
    64 
     60        xfree((void**)&analyses);
     61        xfree((void**)&double_analyses);
     62       
    6563        /*end module: */
    6664        MODULEEND();
  • issm/trunk/src/mex/ModelProcessor/ModelProcessor.h

    r4002 r4063  
    2424/* serial input macros: */
    2525#define MODEL (mxArray*)prhs[0]
    26 #define ANALYSES (mxArray*)prhs[1]
     26#define SOLUTIONTYPE (mxArray*)prhs[1]
     27#define ANALYSES (mxArray*)prhs[2]
    2728
    2829/* serial output macros: */
     
    3940#define NLHS  7
    4041#undef NRHS
    41 #define NRHS  2
     42#define NRHS  3
    4243
    4344#endif  /* _MEXMODELPROCESSOR_H */
Note: See TracChangeset for help on using the changeset viewer.