Changeset 4439
- Timestamp:
- 07/07/10 15:48:47 (15 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 7 added
- 1 deleted
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp
r4200 r4439 11 11 void InputUpdateFromDakotax(FemModel* femmodel, double* variables,char** variables_descriptors,int numvariables){ 12 12 13 int verbose; 14 int qmu_npart; 15 int dummy; 13 int verbose; 14 int qmu_npart; 16 15 double* qmu_part=NULL; 16 int dummy; 17 17 18 18 /*retrieve parameters: */ -
issm/trunk/src/c/modules/OutputResultsx/MatlabWriteResults.cpp
r4321 r4439 24 24 /*output: */ 25 25 mxArray* dataref=NULL; 26 mxArray* processeddataref=NULL; 26 27 mwSize nfields; 27 28 mwSize maxfields; … … 90 91 result->SetMatlabField(dataref); 91 92 } 92 93 94 /*Now, process the patch in the dataref structure, by calling MatlabProcessPatch.m 95 *on the current dataref structure: */ 96 mexCallMATLAB(1,&processeddataref,1,&dataref, "MatlabProcessPatch"); 97 93 98 /*Assign output pointers:*/ 94 *pdataref=dataref; 95 99 *pdataref=processeddataref; 96 100 } 97 101 #endif -
issm/trunk/src/c/modules/Qmux/SpawnCore.cpp
r4193 r4439 24 24 SpawnCoreSerial(responses, numresponses, variables, variables_descriptors,numvariables, (mxArray*)femmodel, counter); 25 25 #else 26 27 26 /*Call SpawnCoreParallel unless counter=-1 on cpu0, in which case, bail out and return 0: */ 28 27 MPI_Bcast(&counter,1,MPI_INT,0,MPI_COMM_WORLD); 29 28 if(counter==-1)return 0; 30 31 29 SpawnCoreParallel(responses, numresponses, variables, variables_descriptors,numvariables, (FemModel*)femmodel,counter); 32 30 #endif 33 34 31 return 1; 35 32 } -
issm/trunk/src/c/modules/Qmux/SpawnCoreParallel.cpp
r4233 r4439 46 46 int dummy; 47 47 int solution_type; 48 void (*solutioncore)(FemModel*) = NULL; 48 49 49 50 /*synchronize all cpus, as CPU 0 is probably late (it is starting the entire dakota strategy!) : */ … … 54 55 femmodel->parameters->FindParam(&verbose,VerboseEnum); 55 56 femmodel->parameters->FindParam(&responses_descriptors,&dummy,ResponseDescriptorsEnum); 57 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 56 58 57 59 /* only cpu 0, running dakota is providing us with variables and variables_descriptors and numresponses: broadcast onto other cpus: */ … … 59 61 60 62 /*Modify core inputs in objects contained in femmodel, to reflect the dakota variables inputs: */ 61 InputUpdateFromDakotax(femmodel ,variables,variables_descriptors,numvariables);63 InputUpdateFromDakotax(femmodel->elements,femmodel->nodes,femmodel->vertices,loads,femmodel->materials,femmodel->parameters,variables,variables_descriptors,numvariables); 62 64 63 /*Run the analysis core solution sequence: */ 64 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); 65 /*Run the core solution sequence: */ 65 66 if(verbose)_printf_("%s%s%s\n","Starting ",EnumAsString(solution_type)," core:"); 66 switch(solution_type){ 67 case DiagnosticAnalysisEnum: 68 diagnostic_core(femmodel); 69 break; 70 case ThermalAnalysisEnum: 71 thermal_core(femmodel); 72 break; 73 case PrognosticAnalysisEnum: 74 prognostic_core(femmodel); 75 break; 76 case Transient2DAnalysisEnum: 77 transient2d_core(femmodel); 78 break; 79 case Transient3DAnalysisEnum: 80 transient3d_core(femmodel); 81 default: 82 ISSMERROR("%s%s%s"," solution_type: ",EnumAsString(solution_type),", not supported yet!"); 83 break; 84 } 67 SolutionConfiguration(NULL,NULL,&solutioncore); solution_core(femmodel); 85 68 86 69 /*compute responses: */ 87 70 if(verbose)_printf_("compute dakota responses:\n"); 88 DakotaResponses (responses,responses_descriptors,numresponses,femmodel);71 DakotaResponsesx(responses,femmodel->elements,femmodel->nodes,femmodel->vertices,loads,femmodel->materials,femmodel->parameters,responses_descriptors,numresponses,); 89 72 90 73 /*Free ressources:*/ -
issm/trunk/src/c/modules/Qmux/SpawnCoreSerial.cpp
r4058 r4439 31 31 32 32 //mexCallMATLAB arrays 33 mxArray* array[ 7];33 mxArray* array[5]; 34 34 35 35 //output from SpawnCore in matlab routine. -
issm/trunk/src/c/solutions/SolutionConfiguration.cpp
r4406 r4439 145 145 146 146 /*Assign output pointers:*/ 147 *pnumanalyses=numanalyses; 148 *panalyses=analyses; 149 *psolutioncore=solutioncore; 147 if(pnumanalyses) *pnumanalyses=numanalyses; 148 if(panalyses)*panalyses=analyses; 149 else xfree((void**)&analyses); 150 if(psolutioncore)*psolutioncore=solutioncore; 150 151 151 152 } -
issm/trunk/src/m/classes/public/parseresultsfromdisk.m
r4319 r4439 29 29 30 30 %process patch if necessary 31 results= ProcessPatch(results);31 results=MatlabProcessPatch(results); 32 32 33 33 fclose(fid); -
issm/trunk/src/m/classes/public/solve.m
r4403 r4439 53 53 54 54 %Launch correct solution sequence 55 md=issm(md );55 md=issm(md,md.analysis_type); 56 56 57 57 %post processes qmu results if necessary -
issm/trunk/src/m/solutions/MatlabProcessPatch.m
r4429 r4439 1 function structure= ProcessPatch(structure);1 function structure=MatlabProcessPatch(structure); 2 2 %PROCESSPATCH - create a structure from a patch 3 3 % -
issm/trunk/src/m/solutions/SpawnCore.m
r4193 r4439 6 6 % 7 7 8 %re coverparameters8 %retrieve parameters 9 9 verbose=femmodel.parameters.Verbose; 10 10 responsedescriptors=femmodel.parameters.responsedescriptors; 11 npart=femmodel.parameters.qmu_npart; 12 part=femmodel.parameters.qmu_part+1; %C indexing 13 numberofnodes=femmodel.parameters.NumberOfNodes; 11 solution_type=femmodel.parameters.SolutionType; 14 12 15 13 displaystring(verbose,'%s%i',[' qmu iteration:'],counter); 16 14 17 15 %first update the inputs to the femmodel using the variables provided to us by dakota. 18 count=1; 19 while count<=numel(variables) 20 21 descriptor=variabledescriptors{count}; 22 if ~qmuisdistributed(descriptor), 23 inputs=add(inputs,descriptor,variables(count),'double'); 24 25 count=count+1; 26 else 27 root=qmuroot(descriptor); 28 param=femmodel.parameters.(root); 29 30 %next npart values in variables are partition values for this param, collect them. 31 partition=variables(count:count+npart-1); 32 33 %update parameter: 34 param=param.*partition(part); 35 36 %add parameter to inputs 37 inputs=add(inputs,root,param,'doublevec',1,numberofnodes); 38 39 %skip next npart iterations, they all deal with the same parameter descriptor 40 count=count+npart; 41 end 42 end 43 16 [femmodel.elements femmodel.loads]=InputUpdateFromDakota(femmodel.elements,femmodel.nodes,femmodel.vertices,femmodel.loads,femmodel.materials,femmodel.parameters,variables,variabledescriptors); 44 17 45 18 %now run the core solution 46 if analysis_type==DiagnosticAnalysisEnum(), 47 48 results=diagnostic_core(femmodel); 49 50 else 51 error(['SpawnCore error message: could not find core solutoin for analysis type: ' analysis_type]); 52 end 53 54 %process results 55 processedresults=processresults(femmodel,results); 19 [dummy,dummy,solutioncore]=SolutionConfiguration(solution_type); 20 eval(['femmodel=' solutioncore '(femmodel);']); 56 21 57 22 %now process the results to get response function values … … 59 24 for i=1:numel(responsedescriptors), 60 25 descriptor=responsedescriptors{i}; 61 responses(i)=qmuresponse(femmodel, results,processedresults,descriptor);26 responses(i)=qmuresponse(femmodel,descriptor); 62 27 end -
issm/trunk/src/m/solutions/issm.m
r4429 r4439 1 function md=issm(md );1 function md=issm(md,solution_type); 2 2 %ISSM - ISSM main parallel program 3 3 % … … 7 7 %timing 8 8 t1=clock; 9 10 solution_type=md.analysis_type;11 9 12 10 %out of solution_type, figure out solution core function pointer, and types of analyses needed: … … 36 34 37 35 displaystring(verbose,'%s',['write results']) 38 results=OutputResults(femmodel.elements, femmodel.nodes , femmodel.vertices , femmodel.loads , femmodel.materials, femmodel.parameters, femmodel.results); 39 md.results.(EnumAsString(solution_type))=ProcessPatch(results); 36 md.results.(EnumAsString(solution_type))=OutputResults(femmodel.elements, femmodel.nodes , femmodel.vertices , femmodel.loads , femmodel.materials, femmodel.parameters, femmodel.results); 40 37 else 41 38 %launch dakota driver for diagnostic core solution -
issm/trunk/src/mex/Makefile.am
r4226 r4439 66 66 TriMeshRefine\ 67 67 InputUpdateFromConstant\ 68 InputUpdateFromDakota\ 68 69 InputUpdateFromSolution\ 69 70 InputUpdateFromVector\ … … 278 279 InputUpdateFromConstant/InputUpdateFromConstant.h 279 280 281 InputUpdateFromDakota_SOURCES = InputUpdateFromDakota/InputUpdateFromDakota.cpp\ 282 InputUpdateFromDakota/InputUpdateFromDakota.h 283 280 284 InputUpdateFromSolution_SOURCES = InputUpdateFromSolution/InputUpdateFromSolution.cpp\ 281 285 InputUpdateFromSolution/InputUpdateFromSolution.h
Note:
See TracChangeset
for help on using the changeset viewer.