Changeset 4103
- Timestamp:
- 06/21/10 16:53:15 (15 years ago)
- Location:
- issm/trunk/src/mex
- Files:
-
- 20 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/GetSolutionFromInputs/GetSolutionFromInputs.cpp
r3836 r4103 17 17 DataSet* materials=NULL; 18 18 Parameters* parameters=NULL; 19 int analysis_type;20 int sub_analysis_type;21 19 Vec ug=NULL; 22 20 … … 36 34 FetchData(&materials,MATERIALS); 37 35 FetchParams(¶meters,PARAMETERS); 38 FetchData(&analysis_type,ANALYSISTYPE);39 FetchData(&sub_analysis_type,SUBANALYSISTYPE);40 36 41 37 /*!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); 43 39 44 40 /*write output datasets: */ … … 60 56 { 61 57 _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__); 63 59 _printf_("\n"); 64 60 } -
issm/trunk/src/mex/GetSolutionFromInputs/GetSolutionFromInputs.h
r3913 r4103 23 23 #define MATERIALS (mxArray*)prhs[4] 24 24 #define PARAMETERS (mxArray*)prhs[5] 25 #define ANALYSISTYPE (mxArray*)prhs[6]26 #define SUBANALYSISTYPE (mxArray*)prhs[7]27 25 28 26 /* serial output macros: */ … … 33 31 #define NLHS 1 34 32 #undef NRHS 35 #define NRHS 833 #define NRHS 6 36 34 37 35 -
issm/trunk/src/mex/Gradj/Gradj.cpp
r3887 r4103 8 8 9 9 /*diverse: */ 10 int noerr=1;10 int noerr = 1; 11 11 12 12 /*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; 23 20 24 21 /* output datasets: */ 25 Vec grad_g=NULL;22 Vec grad_g = NULL; 26 23 27 24 … … 39 36 FetchData(&materials,MATERIALS); 40 37 FetchParams(¶meters,PARAMETERS); 41 parameters->FindParam(&numberofnodes,NumberOfNodesEnum);42 38 parameters->FindParam(&control_type,ControlTypeEnum); 43 FetchData(&analysis_type,ANALYSIS);44 FetchData(&sub_analysis_type,SUBANALYSIS);45 39 46 40 /*!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); 48 42 49 43 /*write output : */ -
issm/trunk/src/mex/Gradj/Gradj.h
r3913 r4103 24 24 #define MATERIALS (mxArray*)prhs[4] 25 25 #define PARAMETERS (mxArray*)prhs[5] 26 #define ANALYSIS (mxArray*)prhs[6]27 #define SUBANALYSIS (mxArray*)prhs[7]28 26 29 27 /* serial output macros: */ … … 34 32 #define NLHS 1 35 33 #undef NRHS 36 #define NRHS 834 #define NRHS 6 37 35 38 36 #endif /* _GRADJ_H */ -
issm/trunk/src/mex/InputDuplicate/InputDuplicate.cpp
r4063 r4103 1 /*\file Input Extrude.c2 *\brief: extrude input vertically1 /*\file InputDuplicate.c 2 *\brief: duplicate input 3 3 */ 4 4 5 #include "./Input Extrude.h"5 #include "./InputDuplicate.h" 6 6 7 7 void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){ … … 17 17 DataSet* materials=NULL; 18 18 Parameters* parameters=NULL; 19 int NameEnum;19 int original_enum,new_enum; 20 20 21 21 /*Boot module: */ … … 23 23 24 24 /*checks on arguments on the matlab side: */ 25 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&Input ExtrudeUsage);25 CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&InputDuplicateUsage); 26 26 27 27 /*Input datasets: */ … … 33 33 FetchParams(¶meters,PARAMETERS); 34 34 35 FetchData(&reinitialized_enum,REINITIALIZEENUM);36 35 FetchData(&original_enum,ORIGINALENUM); 36 FetchData(&new_enum,NEWENUM); 37 37 38 38 /*!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); 40 40 41 41 /*write output : */ … … 55 55 } 56 56 57 void Input ExtrudeUsage(void)57 void InputDuplicateUsage(void) 58 58 { 59 59 _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__); 61 61 _printf_("\n"); 62 62 } -
issm/trunk/src/mex/InputDuplicate/InputDuplicate.h
r4063 r4103 1 1 /* 2 Input Extrude.h2 InputDuplicate.h 3 3 */ 4 4 5 #ifndef _INPUT EXTRUDE_H6 #define _INPUT EXTRUDE_H5 #ifndef _INPUTDUPLICATE_H 6 #define _INPUTDUPLICATE_H 7 7 8 8 /* local prototypes: */ 9 void Input ExtrudeUsage(void);9 void InputDuplicateUsage(void); 10 10 11 11 #include "../../c/modules/modules.h" … … 14 14 15 15 #undef __FUNCT__ 16 #define __FUNCT__ "Input Extrude"16 #define __FUNCT__ "InputDuplicate" 17 17 18 18 /* serial input macros: */ … … 23 23 #define MATERIALS (mxArray*)prhs[4] 24 24 #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] 27 27 28 28 /* serial output macros: */ … … 35 35 #define NRHS 8 36 36 37 #endif /* _INPUT EXTRUDE_H */37 #endif /* _INPUTDUPLICATE_H */ -
issm/trunk/src/mex/Makefile.am
r4100 r4103 26 26 FieldAverageOntoVertices\ 27 27 FieldDepthAverage\ 28 FieldExtrude\29 28 GetSolutionFromInputs\ 30 29 Gradj\ … … 255 254 SystemMatrices/SystemMatrices.h 256 255 257 FieldExtrude_SOURCES = FieldExtrude/FieldExtrude.cpp\258 FieldExtrude/FieldExtrude.h259 260 256 TriMesh_SOURCES = TriMesh/TriMesh.cpp\ 261 257 TriMesh/TriMesh.h -
issm/trunk/src/mex/MassFlux/MassFlux.cpp
r3715 r4103 17 17 DataSet* materials=NULL; 18 18 Parameters* parameters=NULL; 19 19 20 double* segments=NULL; 20 21 int num_segments; 21 double* ug=NULL;22 mxArray* pfield=NULL;23 22 24 23 /* output datasets: */ … … 40 39 parameters->FindParam(&segments,&num_segments,NULL,QmuMassFluxSegmentsEnum); 41 40 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); 44 43 45 /*!Compute mass flux along the profile: */46 MassFluxx(&mass_flux, elements,nodes,vertices,loads,materials,parameters,segments,num_segments,ug);47 44 48 45 /*write output datasets: */ … … 56 53 delete materials; 57 54 delete parameters; 58 xfree((void**)&ug);59 55 60 56 /*end module: */ … … 65 61 { 66 62 _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__); 68 64 _printf_("\n"); 69 65 } -
issm/trunk/src/mex/MeshPartition/MeshPartition.cpp
r2333 r4103 13 13 nel2d_ext,nods2d_ext,elements2d_ext, 14 14 %Diverse 15 numlayers, meshtype)15 numlayers,dim) 16 16 17 17 output: … … 30 30 31 31 /* required input: */ 32 char* meshtype=NULL;32 int dim; 33 33 int numberofelements; 34 34 int numberofgrids; … … 57 57 58 58 /*Fetch data: */ 59 FetchData(& meshtype,mxGetField(MODEL,0,"type"));59 FetchData(&dim,mxGetField(MODEL,0,"type")); 60 60 FetchData(&numberofelements,mxGetField(MODEL,0,"numberofelements")); 61 61 FetchData(&numberofgrids,mxGetField(MODEL,0,"numberofgrids")); 62 62 FetchData(&elements,NULL,&elements_width,mxGetField(MODEL,0,"elements")); 63 63 64 65 66 if (strcmp(meshtype,"3d")==0){ 64 if (dim==3){ 67 65 68 66 FetchData(&numberofelements2d,mxGetField(MODEL,0,"numberofelements2d")); … … 76 74 /*Run partitioning algorithm based on a "clever" use of the Metis partitioner: */ 77 75 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 79 78 80 79 /*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 17 17 DataSet* materials=NULL; 18 18 Parameters* parameters=NULL; 19 int analysis_type;20 int sub_analysis_type;21 19 22 20 /* output datasets: */ … … 36 34 FetchData(&materials,MATERIALS); 37 35 FetchParams(¶meters,PARAMETERS); 38 FetchData(&analysis_type,ANALYSIS);39 FetchData(&sub_analysis_type,SUBANALYSIS);40 36 41 37 /*!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); 43 39 44 40 /*write output : */ -
issm/trunk/src/mex/Misfit/Misfit.h
r3913 r4103 23 23 #define MATERIALS (mxArray*)prhs[4] 24 24 #define PARAMETERS (mxArray*)prhs[5] 25 #define ANALYSIS (mxArray*)prhs[6]26 #define SUBANALYSIS (mxArray*)prhs[7]27 25 28 26 /* serial output macros: */ … … 33 31 #define NLHS 1 34 32 #undef NRHS 35 #define NRHS 833 #define NRHS 6 36 34 37 35 #endif /* _MISFIT_H */ -
issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.cpp
r3844 r4103 17 17 DataSet* materials=NULL; 18 18 Parameters* parameters=NULL; 19 int analysis_type;20 int sub_analysis_type;21 19 22 20 /*output: */ … … 38 36 FetchParams(¶meters,PARAMETERS); 39 37 40 /*parameters: */41 FetchData(&analysis_type,ANALYSIS);42 FetchData(&sub_analysis_type,SUBANALYSIS);43 44 38 /*!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); 46 40 47 41 /*write output datasets: */ … … 65 59 { 66 60 _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__); 68 62 _printf_("\n"); 69 63 } -
issm/trunk/src/mex/PenaltyConstraints/PenaltyConstraints.h
r3913 r4103 23 23 #define MATERIALS (mxArray*)prhs[4] 24 24 #define PARAMETERS (mxArray*)prhs[5] 25 #define ANALYSIS (mxArray*)prhs[6]26 #define SUBANALYSIS (mxArray*)prhs[7]27 25 28 26 /* serial output macros: */ … … 35 33 #define NLHS 3 36 34 #undef NRHS 37 #define NRHS 835 #define NRHS 6 38 36 39 37 #endif /* _PENALTYCONSTRAINTS_H */ -
issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.cpp
r3841 r4103 23 23 Parameters* parameters=NULL; 24 24 int kflag,pflag; 25 int analysis_type;26 int sub_analysis_type;27 25 28 26 /*Boot module: */ … … 45 43 parameters->FindParam(&kflag,KflagEnum); 46 44 parameters->FindParam(&pflag,PflagEnum); 47 FetchData(&analysis_type,ANALYSIS);48 FetchData(&sub_analysis_type,SUBANALYSIS);49 45 50 46 /*!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); 52 48 53 49 /*write output datasets: */ … … 73 69 { 74 70 _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__); 76 72 _printf_("\n"); 77 73 } -
issm/trunk/src/mex/PenaltySystemMatrices/PenaltySystemMatrices.h
r3913 r4103 26 26 #define MATERIALS (mxArray*)prhs[6] 27 27 #define PARAMETERS (mxArray*)prhs[7] 28 #define ANALYSIS (mxArray*)prhs[8]29 #define SUBANALYSIS (mxArray*)prhs[9]30 28 31 29 /* serial output macros: */ … … 38 36 #define NLHS 3 39 37 #undef NRHS 40 #define NRHS 1038 #define NRHS 8 41 39 42 40 #endif /* _PENALTYSYSTEMMATRICES_H */ -
issm/trunk/src/mex/Qmu/Qmu.cpp
r3715 r4103 17 17 18 18 /*input datasets: */ 19 mxArray* models=NULL; 20 int analysis_type; 21 int sub_analysis_type; 19 mxArray* femmodel=NULL; 20 mxArray* parameters=NULL; 22 21 char* dakota_input_file=NULL; 23 22 char* dakota_output_file=NULL; … … 37 36 38 37 /*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")); 46 46 47 47 /*!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); 50 49 51 50 /*Free ressources:*/ … … 61 60 void QmuUsage(void){ 62 61 _printf_("\n"); 63 _printf_(" usage: %s( models,parameters);\n",__FUNCT__);62 _printf_(" usage: %s(femmodel,parameters);\n",__FUNCT__); 64 63 _printf_("\n"); 65 64 } -
issm/trunk/src/mex/Qmu/Qmu.h
r3913 r4103 19 19 20 20 /* serial input macros: */ 21 #define MODELS (mxArray*)prhs[0] 22 #define PARAMETERS (mxArray*)prhs[1] 21 #define FEMMODEL (mxArray*)prhs[0] 23 22 24 23 /* serial output macros: */ … … 28 27 #define NLHS 0 29 28 #undef NRHS 30 #define NRHS 229 #define NRHS 1 31 30 32 31 -
issm/trunk/src/mex/SpcNodes/SpcNodes.cpp
r4003 r4103 17 17 18 18 /* output datasets: */ 19 DofVec*yg=NULL;19 Vec yg=NULL; 20 20 21 21 /*Boot module: */ -
issm/trunk/src/mex/SystemMatrices/SystemMatrices.cpp
r3879 r4103 18 18 Parameters* parameters=NULL; 19 19 int kflag,pflag; 20 int analysis_type;21 int sub_analysis_type;22 20 23 21 /* output datasets: */ … … 43 41 parameters->FindParam(&pflag,PflagEnum); 44 42 45 FetchData(&analysis_type,ANALYSIS);46 FetchData(&sub_analysis_type,SUBANALYSIS);47 48 43 /*!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); 50 45 51 46 /*write output datasets: */ … … 70 65 { 71 66 _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__); 73 68 _printf_("\n"); 74 69 } -
issm/trunk/src/mex/SystemMatrices/SystemMatrices.h
r3913 r4103 24 24 #define MATERIALS (mxArray*)prhs[4] 25 25 #define PARAMETERS (mxArray*)prhs[5] 26 #define ANALYSIS (mxArray*)prhs[6]27 #define SUBANALYSIS (mxArray*)prhs[7]28 26 29 27 /* serial output macros: */ … … 35 33 #define NLHS 2 36 34 #undef NRHS 37 #define NRHS 835 #define NRHS 6 38 36 39 37 #endif /* _SYSTEMMATRICES_H */
Note:
See TracChangeset
for help on using the changeset viewer.