Changeset 4103


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

Move UpdateInputsFromConstant to InputUpdateFromConstant.
Other light debugging.

Location:
issm/trunk/src/mex
Files:
20 edited
1 moved

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/mex/GetSolutionFromInputs/GetSolutionFromInputs.cpp

    r3836 r4103  
    1717        DataSet* materials=NULL;
    1818        Parameters* parameters=NULL;
    19         int      analysis_type;
    20         int      sub_analysis_type;
    2119        Vec      ug=NULL;
    2220
     
    3634        FetchData(&materials,MATERIALS);
    3735        FetchParams(&parameters,PARAMETERS);
    38         FetchData(&analysis_type,ANALYSISTYPE);
    39         FetchData(&sub_analysis_type,SUBANALYSISTYPE);
    4036
    4137        /*!Configure objects:*/
    42         GetSolutionFromInputsx(&ug,elements, nodes,vertices,loads, materials,parameters,analysis_type,sub_analysis_type);
     38        GetSolutionFromInputsx(&ug,elements, nodes,vertices,loads, materials,parameters);
    4339
    4440        /*write output datasets: */
     
    6056{
    6157        _printf_("\n");
    62         _printf_("   usage: [ug] = %s(elements,nodes,vertices,loads, materials,parameters,analysis_type,sub_analysis_type);\n",__FUNCT__);
     58        _printf_("   usage: [ug] = %s(elements,nodes,vertices,loads, materials,parameters);\n",__FUNCT__);
    6359        _printf_("\n");
    6460}
  • issm/trunk/src/mex/GetSolutionFromInputs/GetSolutionFromInputs.h

    r3913 r4103  
    2323#define MATERIALS (mxArray*)prhs[4]
    2424#define PARAMETERS (mxArray*)prhs[5]
    25 #define ANALYSISTYPE (mxArray*)prhs[6]
    26 #define SUBANALYSISTYPE (mxArray*)prhs[7]
    2725
    2826/* serial output macros: */
     
    3331#define NLHS  1
    3432#undef NRHS
    35 #define NRHS  8
     33#define NRHS  6
    3634
    3735
  • issm/trunk/src/mex/Gradj/Gradj.cpp

    r3887 r4103  
    88
    99        /*diverse: */
    10         int   noerr=1;
     10        int         noerr        = 1;
    1111
    1212        /*input datasets: */
    13         DataSet* elements=NULL;
    14         DataSet* nodes=NULL;
    15         DataSet* vertices=NULL;
    16         DataSet* loads=NULL;
    17         DataSet* materials=NULL;
    18         Parameters* parameters=NULL;
    19         int      control_type;
    20         int      analysis_type;
    21         int      sub_analysis_type;
    22         int      numberofnodes;
     13        DataSet    *elements     = NULL;
     14        DataSet    *nodes        = NULL;
     15        DataSet    *vertices     = NULL;
     16        DataSet    *loads        = NULL;
     17        DataSet    *materials    = NULL;
     18        Parameters *parameters   = NULL;
     19        int         control_type;
    2320
    2421        /* output datasets: */
    25         Vec grad_g=NULL;
     22        Vec         grad_g       = NULL;
    2623
    2724
     
    3936        FetchData(&materials,MATERIALS);
    4037        FetchParams(&parameters,PARAMETERS);
    41         parameters->FindParam(&numberofnodes,NumberOfNodesEnum);
    4238        parameters->FindParam(&control_type,ControlTypeEnum);
    43         FetchData(&analysis_type,ANALYSIS);
    44         FetchData(&sub_analysis_type,SUBANALYSIS);
    4539
    4640        /*!Call core code: */
    47         Gradjx(&grad_g,numberofnodes,elements,nodes,vertices,loads,materials,parameters,analysis_type,sub_analysis_type,control_type);
     41        Gradjx(&grad_g,elements,nodes,vertices,loads,materials,parameters,control_type);
    4842
    4943        /*write output : */
  • issm/trunk/src/mex/Gradj/Gradj.h

    r3913 r4103  
    2424#define MATERIALS (mxArray*)prhs[4]
    2525#define PARAMETERS (mxArray*)prhs[5]
    26 #define ANALYSIS (mxArray*)prhs[6]
    27 #define SUBANALYSIS (mxArray*)prhs[7]
    2826
    2927/* serial output macros: */
     
    3432#define NLHS  1
    3533#undef NRHS
    36 #define NRHS  8
     34#define NRHS  6
    3735
    3836#endif  /* _GRADJ_H */
  • issm/trunk/src/mex/InputDuplicate/InputDuplicate.cpp

    r4063 r4103  
    1 /*\file InputExtrude.c
    2  *\brief: extrude input vertically
     1/*\file InputDuplicate.c
     2 *\brief: duplicate input
    33 */
    44
    5 #include "./InputExtrude.h"
     5#include "./InputDuplicate.h"
    66
    77void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
     
    1717        DataSet* materials=NULL;
    1818        Parameters* parameters=NULL;
    19         int      NameEnum;
     19        int      original_enum,new_enum;
    2020
    2121        /*Boot module: */
     
    2323
    2424        /*checks on arguments on the matlab side: */
    25         CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputExtrudeUsage);
     25        CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputDuplicateUsage);
    2626
    2727        /*Input datasets: */
     
    3333        FetchParams(&parameters,PARAMETERS);
    3434       
    35         FetchData(&reinitialized_enum,REINITIALIZEENUM);
    3635        FetchData(&original_enum,ORIGINALENUM);
     36        FetchData(&new_enum,NEWENUM);
    3737
    3838        /*!Call core code: */
    39         InputDuplicatex( elements, nodes, vertices, loads, materials,parameters,reinitialized_enum, original_enum);
     39        InputDuplicatex( elements, nodes, vertices, loads, materials,parameters,original_enum, new_enum);
    4040
    4141        /*write output : */
     
    5555}
    5656
    57 void InputExtrudeUsage(void)
     57void InputDuplicateUsage(void)
    5858{
    5959        _printf_("\n");
    60         _printf_("   usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, reinitialized_enum,original_enum);\n",__FUNCT__);
     60        _printf_("   usage: [elements] = %s(elements, nodes, vertices, loads, materials, parameters, original_enum,new_enum);\n",__FUNCT__);
    6161        _printf_("\n");
    6262}
  • issm/trunk/src/mex/InputDuplicate/InputDuplicate.h

    r4063 r4103  
    11/*
    2         InputExtrude.h
     2        InputDuplicate.h
    33*/
    44
    5 #ifndef _INPUTEXTRUDE_H
    6 #define _INPUTEXTRUDE_H
     5#ifndef _INPUTDUPLICATE_H
     6#define _INPUTDUPLICATE_H
    77
    88/* local prototypes: */
    9 void InputExtrudeUsage(void);
     9void InputDuplicateUsage(void);
    1010
    1111#include "../../c/modules/modules.h"
     
    1414
    1515#undef __FUNCT__
    16 #define __FUNCT__  "InputExtrude"
     16#define __FUNCT__  "InputDuplicate"
    1717
    1818/* serial input macros: */
     
    2323#define MATERIALS (mxArray*)prhs[4]
    2424#define PARAMETERS (mxArray*)prhs[5]
    25 #define REINITIALIZEENUM (mxArray*)prhs[6]
    26 #define ORIGINALENUM (mxArray*)prhs[7]
     25#define ORIGINALENUM (mxArray*)prhs[6]
     26#define NEWENUM (mxArray*)prhs[7]
    2727
    2828/* serial output macros: */
     
    3535#define NRHS  8
    3636
    37 #endif  /* _INPUTEXTRUDE_H */
     37#endif  /* _INPUTDUPLICATE_H */
  • issm/trunk/src/mex/Makefile.am

    r4100 r4103  
    2626                                FieldAverageOntoVertices\
    2727                                FieldDepthAverage\
    28                                 FieldExtrude\
    2928                                GetSolutionFromInputs\
    3029                                Gradj\
     
    255254                          SystemMatrices/SystemMatrices.h
    256255
    257 FieldExtrude_SOURCES = FieldExtrude/FieldExtrude.cpp\
    258                           FieldExtrude/FieldExtrude.h
    259 
    260256TriMesh_SOURCES = TriMesh/TriMesh.cpp\
    261257                          TriMesh/TriMesh.h
  • issm/trunk/src/mex/MassFlux/MassFlux.cpp

    r3715 r4103  
    1717        DataSet* materials=NULL;
    1818        Parameters* parameters=NULL;
     19
    1920        double*  segments=NULL;
    2021        int      num_segments;
    21         double*  ug=NULL;
    22         mxArray* pfield=NULL;
    2322
    2423        /* output datasets: */
     
    4039        parameters->FindParam(&segments,&num_segments,NULL,QmuMassFluxSegmentsEnum);
    4140
    42         /*results: */
    43         FetchData(&ug,NULL,NULL,UG);
     41        /*!Compute mass flux along the profile: */
     42        MassFluxx(&mass_flux, elements,nodes,vertices,loads,materials,parameters,segments,num_segments);
    4443
    45         /*!Compute mass flux along the profile: */
    46         MassFluxx(&mass_flux, elements,nodes,vertices,loads,materials,parameters,segments,num_segments,ug);
    4744
    4845        /*write output datasets: */
     
    5653        delete materials;
    5754        delete parameters;
    58         xfree((void**)&ug);
    5955
    6056        /*end module: */
     
    6561{
    6662        _printf_("\n");
    67         _printf_("   usage: [Kgg,pg] = %s(eleemnts,nodes,loads,materials,params,analysis_type);\n",__FUNCT__);
     63        _printf_("   usage: [mass_flux] = %s(elements,nodes,vertices,loads,materials,parameters);\n",__FUNCT__);
    6864        _printf_("\n");
    6965}
  • issm/trunk/src/mex/MeshPartition/MeshPartition.cpp

    r2333 r4103  
    1313        nel2d_ext,nods2d_ext,elements2d_ext,
    1414        %Diverse
    15         numlayers,meshtype)
     15        numlayers,dim)
    1616
    1717        output:
     
    3030
    3131        /* required input: */
    32         char* meshtype=NULL;
     32        int dim;
    3333        int numberofelements;
    3434        int numberofgrids;
     
    5757
    5858        /*Fetch data: */
    59         FetchData(&meshtype,mxGetField(MODEL,0,"type"));
     59        FetchData(&dim,mxGetField(MODEL,0,"type"));
    6060        FetchData(&numberofelements,mxGetField(MODEL,0,"numberofelements"));
    6161        FetchData(&numberofgrids,mxGetField(MODEL,0,"numberofgrids"));
    6262        FetchData(&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements"));
    6363
    64        
    65        
    66         if (strcmp(meshtype,"3d")==0){
     64        if (dim==3){
    6765       
    6866                FetchData(&numberofelements2d,mxGetField(MODEL,0,"numberofelements2d"));
     
    7674        /*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */
    7775        MeshPartitionx(&int_element_partitioning,&int_node_partitioning,numberofelements,numberofgrids,elements,
    78                 numberofelements2d,numberofgrids2d,elements2d,numlayers,elements_width,meshtype,numareas);
     76                numberofelements2d,numberofgrids2d,elements2d,numlayers,elements_width,dim,numareas);
     77
    7978
    8079        /*Post process node_partitioning and element_partitioning to be in double format. Metis needed them in int* format: */
  • issm/trunk/src/mex/Misfit/Misfit.cpp

    r3841 r4103  
    1717        DataSet* materials=NULL;
    1818        Parameters* parameters=NULL;
    19         int      analysis_type;
    20         int      sub_analysis_type;
    2119
    2220        /* output datasets: */
     
    3634        FetchData(&materials,MATERIALS);
    3735        FetchParams(&parameters,PARAMETERS);
    38         FetchData(&analysis_type,ANALYSIS);
    39         FetchData(&sub_analysis_type,SUBANALYSIS);
    4036
    4137        /*!Call core code: */
    42         Misfitx(&J, elements,nodes,vertices,loads,materials,parameters,analysis_type,sub_analysis_type);
     38        Misfitx(&J, elements,nodes,vertices,loads,materials,parameters);
    4339
    4440        /*write output : */
  • issm/trunk/src/mex/Misfit/Misfit.h

    r3913 r4103  
    2323#define MATERIALS (mxArray*)prhs[4]
    2424#define PARAMETERS (mxArray*)prhs[5]
    25 #define ANALYSIS (mxArray*)prhs[6]
    26 #define SUBANALYSIS (mxArray*)prhs[7]
    2725
    2826/* serial output macros: */
     
    3331#define NLHS  1
    3432#undef NRHS
    35 #define NRHS  8
     33#define NRHS  6
    3634
    3735#endif  /* _MISFIT_H */
  • issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp

    r3844 r4103  
    1717        DataSet* materials=NULL;
    1818        Parameters* parameters=NULL;
    19         int      analysis_type;
    20         int      sub_analysis_type;
    2119
    2220        /*output: */
     
    3836        FetchParams(&parameters,PARAMETERS);
    3937
    40         /*parameters: */
    41         FetchData(&analysis_type,ANALYSIS);
    42         FetchData(&sub_analysis_type,SUBANALYSIS);
    43 
    4438        /*!Generate internal degree of freedom numbers: */
    45         PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,vertices, loads,materials,parameters,analysis_type,sub_analysis_type);
     39        PenaltyConstraintsx(&converged, &num_unstable_constraints, elements,nodes,vertices, loads,materials,parameters);
    4640
    4741        /*write output datasets: */
     
    6559{
    6660        _printf_("\n");
    67         _printf_("   usage: [loads, constraints_converged, num_unstable_constraints] = %s(elements,nodes,vertices,loads,materials,params,analysis_type,sub_analysis_type);\n",__FUNCT__);
     61        _printf_("   usage: [loads, constraints_converged, num_unstable_constraints] = %s(elements,nodes,vertices,loads,materials,params);\n",__FUNCT__);
    6862        _printf_("\n");
    6963}
  • issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.h

    r3913 r4103  
    2323#define MATERIALS (mxArray*)prhs[4]
    2424#define PARAMETERS (mxArray*)prhs[5]
    25 #define ANALYSIS (mxArray*)prhs[6]
    26 #define SUBANALYSIS (mxArray*)prhs[7]
    2725
    2826/* serial output macros: */
     
    3533#define NLHS  3
    3634#undef NRHS
    37 #define NRHS  8
     35#define NRHS  6
    3836
    3937#endif  /* _PENALTYCONSTRAINTS_H */
  • issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp

    r3841 r4103  
    2323        Parameters* parameters=NULL;
    2424        int      kflag,pflag;
    25         int      analysis_type;
    26         int      sub_analysis_type;
    2725       
    2826        /*Boot module: */
     
    4543        parameters->FindParam(&kflag,KflagEnum);
    4644        parameters->FindParam(&pflag,PflagEnum);
    47         FetchData(&analysis_type,ANALYSIS);
    48         FetchData(&sub_analysis_type,SUBANALYSIS);
    4945
    5046        /*!Generate stiffnesses from penalties: */
    51         PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,vertices,loads,materials,parameters,kflag,pflag,analysis_type,sub_analysis_type);
     47        PenaltySystemMatricesx(Kgg, pg,&kmax,elements,nodes,vertices,loads,materials,parameters,kflag,pflag);
    5248
    5349        /*write output datasets: */
     
    7369{
    7470        _printf_("\n");
    75         _printf_("   usage: [Kgg,pg] = %s(Kggin,pgin,elements,nodes,vertices,loads,materials,params,analysis_type,sub_analysis_type);\n",__FUNCT__);
     71        _printf_("   usage: [Kgg,pg] = %s(Kggin,pgin,elements,nodes,vertices,loads,materials,params);\n",__FUNCT__);
    7672        _printf_("\n");
    7773}
  • issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.h

    r3913 r4103  
    2626#define MATERIALS (mxArray*)prhs[6]
    2727#define PARAMETERS (mxArray*)prhs[7]
    28 #define ANALYSIS (mxArray*)prhs[8]
    29 #define SUBANALYSIS (mxArray*)prhs[9]
    3028
    3129/* serial output macros: */
     
    3836#define NLHS  3
    3937#undef NRHS
    40 #define NRHS  10
     38#define NRHS  8
    4139
    4240#endif  /* _PENALTYSYSTEMMATRICES_H */
  • issm/trunk/src/mex/Qmu/Qmu.cpp

    r3715 r4103  
    1717
    1818        /*input datasets: */
    19         mxArray* models=NULL;
    20         int      analysis_type;
    21         int      sub_analysis_type;
     19        mxArray* femmodel=NULL;
     20        mxArray* parameters=NULL;
    2221        char*    dakota_input_file=NULL;
    2322        char*    dakota_output_file=NULL;
     
    3736
    3837        /*Input datasets: */
    39         models=MODELS;
    40        
    41         FetchData(&analysis_type,mxGetField(PARAMETERS,0,"analysis_type"));
    42         FetchData(&sub_analysis_type,mxGetField(PARAMETERS,0,"sub_analysis_type"));
    43         FetchData(&dakota_input_file,mxGetField(PARAMETERS,0,"qmuinname"));
    44         FetchData(&dakota_output_file,mxGetField(PARAMETERS,0,"qmuoutname"));
    45         FetchData(&dakota_error_file,mxGetField(PARAMETERS,0,"qmuerrname"));
     38        femmodel=FEMMODEL;
     39
     40        /*get parameters from femmodel structure: */
     41        parameters=mxGetField(FEMMODEL,0,"parameters");
     42
     43        FetchData(&dakota_input_file,mxGetField(parameters,0,"qmuinname"));
     44        FetchData(&dakota_output_file,mxGetField(parameters,0,"qmuoutname"));
     45        FetchData(&dakota_error_file,mxGetField(parameters,0,"qmuerrname"));
    4646
    4747        /*!Generate internal degree of freedom numbers: */
    48         Qmux(models,analysis_type,sub_analysis_type,dakota_input_file,dakota_output_file,dakota_error_file);
    49 
     48        Qmux(femmodel,dakota_input_file,dakota_output_file,dakota_error_file);
    5049
    5150        /*Free ressources:*/
     
    6160void QmuUsage(void){
    6261        _printf_("\n");
    63         _printf_("   usage: %s(models,parameters);\n",__FUNCT__);
     62        _printf_("   usage: %s(femmodel,parameters);\n",__FUNCT__);
    6463        _printf_("\n");
    6564}
  • issm/trunk/src/mex/Qmu/Qmu.h

    r3913 r4103  
    1919
    2020/* serial input macros: */
    21 #define MODELS (mxArray*)prhs[0]
    22 #define PARAMETERS (mxArray*)prhs[1]
     21#define FEMMODEL (mxArray*)prhs[0]
    2322
    2423/* serial output macros: */
     
    2827#define NLHS  0
    2928#undef NRHS
    30 #define NRHS  2
     29#define NRHS  1
    3130
    3231
  • issm/trunk/src/mex/SpcNodes/SpcNodes.cpp

    r4003 r4103  
    1717
    1818        /* output datasets: */
    19         DofVec*         yg=NULL;
     19        Vec         yg=NULL;
    2020
    2121        /*Boot module: */
  • issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp

    r3879 r4103  
    1818        Parameters* parameters=NULL;
    1919        int         kflag,pflag;
    20         int         analysis_type;
    21         int         sub_analysis_type;
    2220       
    2321        /* output datasets: */
     
    4341        parameters->FindParam(&pflag,PflagEnum);
    4442
    45         FetchData(&analysis_type,ANALYSIS);
    46         FetchData(&sub_analysis_type,SUBANALYSIS);
    47 
    4843        /*!Generate internal degree of freedom numbers: */
    49         SystemMatricesx(&Kgg, &pg,elements,nodes,vertices,loads,materials,parameters,kflag,pflag,analysis_type,sub_analysis_type);
     44        SystemMatricesx(&Kgg, &pg,elements,nodes,vertices,loads,materials,parameters,kflag,pflag);
    5045
    5146        /*write output datasets: */
     
    7065{
    7166        _printf_("\n");
    72         _printf_("   usage: [Kgg,pg] = %s(elements,nodes,vertices,loads,materials,parameters,analysis_type,sub_analysis_type);\n",__FUNCT__);
     67        _printf_("   usage: [Kgg,pg] = %s(elements,nodes,vertices,loads,materials,parameters);\n",__FUNCT__);
    7368        _printf_("\n");
    7469}
  • issm/trunk/src/mex/SystemMatrices/SystemMatrices.h

    r3913 r4103  
    2424#define MATERIALS (mxArray*)prhs[4]
    2525#define PARAMETERS (mxArray*)prhs[5]
    26 #define ANALYSIS (mxArray*)prhs[6]
    27 #define SUBANALYSIS (mxArray*)prhs[7]
    2826
    2927/* serial output macros: */
     
    3533#define NLHS  2
    3634#undef NRHS
    37 #define NRHS  8
     35#define NRHS  6
    3836
    3937#endif  /* _SYSTEMMATRICES_H */
Note: See TracChangeset for help on using the changeset viewer.