Changeset 24168


Ignore:
Timestamp:
09/27/19 10:52:43 (5 years ago)
Author:
Eric.Larour
Message:

CHG: replacing partitioning vector with vpartition and epartition to support
both element and vertex based partitioning vectors.

Location:
issm/trunk-jpl/src
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/modules/AverageOntoPartitionx/AverageOntoPartitionx.cpp

    r18521 r24168  
    1616void AverageOntoPartitionx(double** paverage, Elements* elements, Nodes* nodes, Vertices* vertices, Loads* loads, Materials* materials, Parameters* parameters,double* vertex_response){
    1717
    18         int     dummy;
    1918        int     npart;
    20         double *qmu_part  = NULL;
     19        double *qmu_vpart  = NULL;
    2120
    2221        /*output: */
     
    2726
    2827        /*First, recover qmu partition of vertices: */
    29         parameters->FindParam(&qmu_part,&dummy,QmuPartitionEnum);
     28        parameters->FindParam(&qmu_vpart,NULL,QmuVpartitionEnum);
    3029
    3130        /*Some parameters: */
     
    4241        for(int i=0;i<elements->Size();i++){
    4342                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
    44                 element->AverageOntoPartition(partition_contributions,partition_areas,vertex_response,qmu_part);
     43                element->AverageOntoPartition(partition_contributions,partition_areas,vertex_response,qmu_vpart);
    4544        }
    4645
     
    5655
    5756        /*Free ressources:*/
    58         xDelete<double>(qmu_part);
     57        xDelete<double>(qmu_vpart);
    5958        delete partition_contributions;
    6059        delete partition_areas;
  • issm/trunk-jpl/src/c/modules/InputUpdateFromDakotax/InputUpdateFromDakotax.cpp

    r24157 r24168  
    2020        int     ncols;
    2121        int     npart;
    22         double *qmu_part  = NULL;
    23         int     qmu_npart;
     22        double *qmu_vpart  = NULL;
     23        double *qmu_epart  = NULL;
    2424
    2525        double *distributed_values = NULL;
     
    3030        /*retrieve parameters: */
    3131        femmodel->parameters->FindParam(&npart,QmuNumberofpartitionsEnum);
    32         femmodel->parameters->FindParam(&qmu_part,&qmu_npart,QmuPartitionEnum);
     32        femmodel->parameters->FindParam(&qmu_vpart,NULL,QmuVpartitionEnum);
     33        femmodel->parameters->FindParam(&qmu_epart,NULL,QmuEpartitionEnum);
    3334        numberofvertices=femmodel->vertices->NumberOfVertices();
    3435        numberofelements=femmodel->elements->NumberOfElements();
     
    6061
    6162
    62                         /*We've got the parameter, we need to update it using qmu_part and the distributed_values.
    63                          * Several cases: we either have a nrows=numberofvertices or nrows=numberofelements, and
    64                          * in addition, it can be either a static or transient (nrows+1) vector.
    65                          * Deal with both cases accordingly: */
     63                        /*We've got the parameter, we need to update it using qmu_vpart or qmu_epart (depending on whether
     64                         * it is element or vertex distributed), and the distributed_values.
     65                         In addition, the parameter can be either a static or transient (nrows+1) vector. */
     66                       
    6667                        //_printf_("nrows: " << nrows << " numberofvertices: " << numberofvertices << " qmu_npart: " << qmu_npart << "\n");
    6768
    68                         if (qmu_npart==numberofvertices){
     69                        if (nrows==numberofvertices | nrows==numberofvertices+1){
    6970                                for(k=0;k<numberofvertices;k++){
    7071                                        for(l=0;l<ncols;l++){
    71                                                 *(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_part[k]];
     72                                                *(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_vpart[k]];
    7273                                        }
    7374                                }
    7475                        }
    75                         else if (qmu_npart==numberofelements){
     76                        else if (nrows==numberofelements | nrows==numberofelements+1){
    7677                                for(k=0;k<numberofelements;k++){
    7778                                        for(l=0;l<ncols;l++){
    78                                                 *(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_part[k]];
     79                                                *(parameter+ncols*k+l)=*(parameter+ncols*k+l)*distributed_values[(int)qmu_epart[k]];
    7980                                        }
    8081                                }
     
    100101
    101102                        /*Update inputs using the parameter matrix: */
    102                         if(qmu_npart==numberofvertices)
     103                        if(nrows==numberofvertices| nrows==numberofvertices+1)
    103104                                InputUpdateFromMatrixDakotax(femmodel, parameter, nrows,ncols,StringToEnumx(root), VertexEnum);
    104105                        else
     
    125126
    126127        /*Free ressources:*/
    127         xDelete<double>(qmu_part);
     128        xDelete<double>(qmu_vpart);
     129        xDelete<double>(qmu_epart);
    128130}
  • issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp

    r24163 r24168  
    1313        /*variable declarations*/
    1414        int          i;
    15         int         *part                   = NULL;
    16         double      *dpart                  = NULL;
     15        double      *vpart                  = NULL;
     16        double      *epart                  = NULL;
    1717        int          npart;
    1818        char       **responsedescriptors    = NULL;
     
    6666                parameters->AddObject(new StringArrayParam(QmuResponsedescriptorsEnum,responsedescriptors,numresponsedescriptors));
    6767
    68                 /*Deal with partitioning*/
    69                 /*partition vertices in iomodel->qmu_npart parts, unless a partition is already present: */
     68                /*Load partitioning vectors (both vertex and element based: */
    7069                parameters->AddObject(iomodel->CopyConstantObject("md.qmu.numberofpartitions",QmuNumberofpartitionsEnum));
    71                 iomodel->FetchData(&dpart,&npart,NULL,"md.qmu.partition");
    72                 if(!dpart) _error_("md.qmu.partition is empty");
    73                 parameters->AddObject(new DoubleVecParam(QmuPartitionEnum,dpart,npart));
     70                iomodel->FetchData(&vpart,&npart,NULL,"md.qmu.vpartition"); if(!vpart) _error_("md.qmu.vpartition is empty");
     71                parameters->AddObject(new DoubleVecParam(QmuEpartitionEnum,vpart,npart));
     72               
     73                iomodel->FetchData(&epart,&npart,NULL,"md.qmu.epartition"); if(!epart) _error_("md.qmu.epartition is empty");
     74                parameters->AddObject(new DoubleVecParam(QmuVpartitionEnum,epart,npart));
    7475
    7576                /*Deal with data needed because of qmu variables*/
     
    111112                }
    112113                xDelete<char*>(variabledescriptors);
    113                 xDelete<int>(part);
    114                 xDelete<double>(dpart);
     114                xDelete<double>(vpart);
     115                xDelete<double>(epart);
    115116                xDelete<char>(qmuinname);
    116117                xDelete<char>(qmuerrname);
  • issm/trunk-jpl/src/c/shared/Enum/Enum.vim

    r24097 r24168  
    115115syn keyword cConstant DamageC2Enum
    116116syn keyword cConstant DamageC3Enum
     117syn keyword cConstant DamageC4Enum
    117118syn keyword cConstant DamageEnum
    118119syn keyword cConstant DamageEquivStressEnum
     
    125126syn keyword cConstant DamageStabilizationEnum
    126127syn keyword cConstant DamageStressThresholdEnum
     128syn keyword cConstant DamageStressUBoundEnum
    127129syn keyword cConstant DebugProfilingEnum
    128130syn keyword cConstant DomainDimensionEnum
     
    288290syn keyword cConstant QmuNumberofpartitionsEnum
    289291syn keyword cConstant QmuOutNameEnum
    290 syn keyword cConstant QmuPartitionEnum
     292syn keyword cConstant QmuEpartitionEnum
     293syn keyword cConstant QmuVpartitionEnum
    291294syn keyword cConstant QmuResponsedescriptorsEnum
    292295syn keyword cConstant QmuVariableDescriptorsEnum
     
    395398syn keyword cConstant StressbalanceRiftPenaltyThresholdEnum
    396399syn keyword cConstant StressbalanceShelfDampeningEnum
     400syn keyword cConstant ThermalIsdrainicecolumnEnum
    397401syn keyword cConstant ThermalIsdynamicbasalspcEnum
    398402syn keyword cConstant ThermalIsenthalpyEnum
     
    405409syn keyword cConstant ThermalRequestedOutputsEnum
    406410syn keyword cConstant ThermalStabilizationEnum
     411syn keyword cConstant ThermalWatercolumnUpperlimitEnum
    407412syn keyword cConstant TimeEnum
    408413syn keyword cConstant TimesteppingCflCoefficientEnum
     
    459464syn keyword cConstant BasalforcingsIsmip6TfShelfEnum
    460465syn keyword cConstant BasalforcingsIsmip6MeltAnomalyEnum
     466syn keyword cConstant BasalforcingsOceanSalinityEnum
     467syn keyword cConstant BasalforcingsOceanTempEnum
    461468syn keyword cConstant BasalforcingsPicoBasinIdEnum
    462469syn keyword cConstant BasalforcingsPicoBoxIdEnum
     
    783790syn keyword cConstant ThicknessOldEnum
    784791syn keyword cConstant ThicknessPositiveEnum
     792syn keyword cConstant ThicknessResidualEnum
    785793syn keyword cConstant VelEnum
    786794syn keyword cConstant VxAverageEnum
     
    928936syn keyword cConstant BasalforcingsIsmip6Enum
    929937syn keyword cConstant BasalforcingsPicoEnum
     938syn keyword cConstant BeckmannGoosseFloatingMeltRateEnum
    930939syn keyword cConstant BedSlopeSolutionEnum
    931940syn keyword cConstant BoolExternalResultEnum
     
    12821291syn keyword cType Cfsurfacesquare
    12831292syn keyword cType Channel
    1284 syn keyword cType classes
    12851293syn keyword cType Constraint
    12861294syn keyword cType Constraints
     
    12891297syn keyword cType ControlInput
    12901298syn keyword cType Covertree
     1299syn keyword cType DataSetParam
    12911300syn keyword cType DatasetInput
    1292 syn keyword cType DataSetParam
    12931301syn keyword cType Definition
    12941302syn keyword cType DependentObject
     
    13031311syn keyword cType ElementHook
    13041312syn keyword cType ElementMatrix
     1313syn keyword cType ElementVector
    13051314syn keyword cType Elements
    1306 syn keyword cType ElementVector
    13071315syn keyword cType ExponentialVariogram
    13081316syn keyword cType ExternalResult
     
    13111319syn keyword cType Friction
    13121320syn keyword cType Gauss
    1313 syn keyword cType GaussianVariogram
    1314 syn keyword cType gaussobjects
    13151321syn keyword cType GaussPenta
    13161322syn keyword cType GaussSeg
    13171323syn keyword cType GaussTetra
    13181324syn keyword cType GaussTria
     1325syn keyword cType GaussianVariogram
    13191326syn keyword cType GenericExternalResult
    13201327syn keyword cType GenericOption
     
    13241331syn keyword cType Input
    13251332syn keyword cType Inputs
    1326 syn keyword cType IntArrayInput
    13271333syn keyword cType IntInput
    13281334syn keyword cType IntMatParam
     
    13321338syn keyword cType IssmDirectApplicInterface
    13331339syn keyword cType IssmParallelDirectApplicInterface
    1334 syn keyword cType krigingobjects
    13351340syn keyword cType Load
    13361341syn keyword cType Loads
     
    13431348syn keyword cType Matice
    13441349syn keyword cType Matlitho
    1345 syn keyword cType matrixobjects
    13461350syn keyword cType MatrixParam
    13471351syn keyword cType Misfit
     
    13561360syn keyword cType Observations
    13571361syn keyword cType Option
     1362syn keyword cType OptionUtilities
    13581363syn keyword cType Options
    1359 syn keyword cType OptionUtilities
    13601364syn keyword cType Param
    13611365syn keyword cType Parameters
     
    13701374syn keyword cType Regionaloutput
    13711375syn keyword cType Results
     1376syn keyword cType RiftStruct
    13721377syn keyword cType Riftfront
    1373 syn keyword cType RiftStruct
    13741378syn keyword cType Seg
    13751379syn keyword cType SegInput
     1380syn keyword cType SegRef
    13761381syn keyword cType Segment
    1377 syn keyword cType SegRef
    13781382syn keyword cType SpcDynamic
    13791383syn keyword cType SpcStatic
     
    13951399syn keyword cType Vertex
    13961400syn keyword cType Vertices
     1401syn keyword cType classes
     1402syn keyword cType gaussobjects
     1403syn keyword cType krigingobjects
     1404syn keyword cType matrixobjects
    13971405syn keyword cType AdjointBalancethickness2Analysis
    13981406syn keyword cType AdjointBalancethicknessAnalysis
     
    14131421syn keyword cType FreeSurfaceBaseAnalysis
    14141422syn keyword cType FreeSurfaceTopAnalysis
     1423syn keyword cType GLheightadvectionAnalysis
    14151424syn keyword cType GiaIvinsAnalysis
    1416 syn keyword cType GLheightadvectionAnalysis
    14171425syn keyword cType HydrologyDCEfficientAnalysis
    14181426syn keyword cType HydrologyDCInefficientAnalysis
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r24146 r24168  
    284284        QmuNumberofpartitionsEnum,
    285285        QmuOutNameEnum,
    286         QmuPartitionEnum,
     286        QmuEpartitionEnum,
     287        QmuVpartitionEnum,
    287288        QmuResponsedescriptorsEnum,
    288289        QmuVariableDescriptorsEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r24146 r24168  
    292292                case QmuNumberofpartitionsEnum : return "QmuNumberofpartitions";
    293293                case QmuOutNameEnum : return "QmuOutName";
    294                 case QmuPartitionEnum : return "QmuPartition";
     294                case QmuEpartitionEnum : return "QmuEpartition";
     295                case QmuVpartitionEnum : return "QmuVpartition";
    295296                case QmuResponsedescriptorsEnum : return "QmuResponsedescriptors";
    296297                case QmuVariableDescriptorsEnum : return "QmuVariableDescriptors";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r24146 r24168  
    298298              else if (strcmp(name,"QmuNumberofpartitions")==0) return QmuNumberofpartitionsEnum;
    299299              else if (strcmp(name,"QmuOutName")==0) return QmuOutNameEnum;
    300               else if (strcmp(name,"QmuPartition")==0) return QmuPartitionEnum;
     300              else if (strcmp(name,"QmuEpartition")==0) return QmuEpartitionEnum;
     301              else if (strcmp(name,"QmuVpartition")==0) return QmuVpartitionEnum;
    301302              else if (strcmp(name,"QmuResponsedescriptors")==0) return QmuResponsedescriptorsEnum;
    302303              else if (strcmp(name,"QmuVariableDescriptors")==0) return QmuVariableDescriptorsEnum;
     
    382383              else if (strcmp(name,"SmbRunoffref")==0) return SmbRunoffrefEnum;
    383384              else if (strcmp(name,"SmbSealev")==0) return SmbSealevEnum;
    384               else if (strcmp(name,"SmbSwIdx")==0) return SmbSwIdxEnum;
    385385         else stage=4;
    386386   }
    387387   if(stage==4){
    388               if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum;
     388              if (strcmp(name,"SmbSwIdx")==0) return SmbSwIdxEnum;
     389              else if (strcmp(name,"SmbT0dry")==0) return SmbT0dryEnum;
    389390              else if (strcmp(name,"SmbT0wet")==0) return SmbT0wetEnum;
    390391              else if (strcmp(name,"SmbTdiff")==0) return SmbTdiffEnum;
     
    505506              else if (strcmp(name,"CrevasseDepth")==0) return CrevasseDepthEnum;
    506507              else if (strcmp(name,"DamageD")==0) return DamageDEnum;
    507               else if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"DamageF")==0) return DamageFEnum;
     511              if (strcmp(name,"DamageDbar")==0) return DamageDbarEnum;
     512              else if (strcmp(name,"DamageF")==0) return DamageFEnum;
    512513              else if (strcmp(name,"DegreeOfChannelization")==0) return DegreeOfChannelizationEnum;
    513514              else if (strcmp(name,"DeviatoricStresseffective")==0) return DeviatoricStresseffectiveEnum;
     
    628629              else if (strcmp(name,"MaterialsRheologyEbar")==0) return MaterialsRheologyEbarEnum;
    629630              else if (strcmp(name,"MaterialsRheologyEc")==0) return MaterialsRheologyEcEnum;
    630               else if (strcmp(name,"MaterialsRheologyEcbar")==0) return MaterialsRheologyEcbarEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
     634              if (strcmp(name,"MaterialsRheologyEcbar")==0) return MaterialsRheologyEcbarEnum;
     635              else if (strcmp(name,"MaterialsRheologyEs")==0) return MaterialsRheologyEsEnum;
    635636              else if (strcmp(name,"MaterialsRheologyEsbar")==0) return MaterialsRheologyEsbarEnum;
    636637              else if (strcmp(name,"MaterialsRheologyN")==0) return MaterialsRheologyNEnum;
     
    751752              else if (strcmp(name,"SmbTeValue")==0) return SmbTeValueEnum;
    752753              else if (strcmp(name,"SmbTemperaturesAnomaly")==0) return SmbTemperaturesAnomalyEnum;
    753               else if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"SmbTemperaturesPresentday")==0) return SmbTemperaturesPresentdayEnum;
     757              if (strcmp(name,"SmbTemperaturesLgm")==0) return SmbTemperaturesLgmEnum;
     758              else if (strcmp(name,"SmbTemperaturesPresentday")==0) return SmbTemperaturesPresentdayEnum;
    758759              else if (strcmp(name,"SmbTemperaturesReconstructed")==0) return SmbTemperaturesReconstructedEnum;
    759760              else if (strcmp(name,"SmbTini")==0) return SmbTiniEnum;
     
    874875              else if (strcmp(name,"Outputdefinition48")==0) return Outputdefinition48Enum;
    875876              else if (strcmp(name,"Outputdefinition49")==0) return Outputdefinition49Enum;
    876               else if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
    877877         else stage=8;
    878878   }
    879879   if(stage==8){
    880               if (strcmp(name,"Outputdefinition50")==0) return Outputdefinition50Enum;
     880              if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
     881              else if (strcmp(name,"Outputdefinition50")==0) return Outputdefinition50Enum;
    881882              else if (strcmp(name,"Outputdefinition51")==0) return Outputdefinition51Enum;
    882883              else if (strcmp(name,"Outputdefinition52")==0) return Outputdefinition52Enum;
     
    997998              else if (strcmp(name,"DefaultCalving")==0) return DefaultCalvingEnum;
    998999              else if (strcmp(name,"Dense")==0) return DenseEnum;
    999               else if (strcmp(name,"DependentObject")==0) return DependentObjectEnum;
    10001000         else stage=9;
    10011001   }
    10021002   if(stage==9){
    1003               if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
     1003              if (strcmp(name,"DependentObject")==0) return DependentObjectEnum;
     1004              else if (strcmp(name,"DepthAverageAnalysis")==0) return DepthAverageAnalysisEnum;
    10041005              else if (strcmp(name,"DeviatoricStressErrorEstimator")==0) return DeviatoricStressErrorEstimatorEnum;
    10051006              else if (strcmp(name,"Divergence")==0) return DivergenceEnum;
     
    11201121              else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
    11211122              else if (strcmp(name,"Masscon")==0) return MassconEnum;
    1122               else if (strcmp(name,"Massconaxpby")==0) return MassconaxpbyEnum;
    11231123         else stage=10;
    11241124   }
    11251125   if(stage==10){
    1126               if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
     1126              if (strcmp(name,"Massconaxpby")==0) return MassconaxpbyEnum;
     1127              else if (strcmp(name,"Massfluxatgate")==0) return MassfluxatgateEnum;
    11271128              else if (strcmp(name,"MasstransportAnalysis")==0) return MasstransportAnalysisEnum;
    11281129              else if (strcmp(name,"MasstransportSolution")==0) return MasstransportSolutionEnum;
     
    12431244              else if (strcmp(name,"Sset")==0) return SsetEnum;
    12441245              else if (strcmp(name,"SteadystateSolution")==0) return SteadystateSolutionEnum;
    1245               else if (strcmp(name,"StressIntensityFactor")==0) return StressIntensityFactorEnum;
    12461246         else stage=11;
    12471247   }
    12481248   if(stage==11){
    1249               if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
     1249              if (strcmp(name,"StressIntensityFactor")==0) return StressIntensityFactorEnum;
     1250              else if (strcmp(name,"StressbalanceAnalysis")==0) return StressbalanceAnalysisEnum;
    12501251              else if (strcmp(name,"StressbalanceConvergenceNumSteps")==0) return StressbalanceConvergenceNumStepsEnum;
    12511252              else if (strcmp(name,"StressbalanceSIAAnalysis")==0) return StressbalanceSIAAnalysisEnum;
  • issm/trunk-jpl/src/m/classes/qmu.m

    r24162 r24168  
    1212                params                      = struct();
    1313                results                     = struct();
    14                 partition                   = NaN;
     14                vpartition                   = NaN;
     15                epartition                   = NaN;
    1516                numberofpartitions          = 0;
    1617                numberofresponses           = 0;
     
    2526        methods
    2627                function self = extrude(self,md) % {{{
    27                         self.partition=project3d(md,'vector',self.partition','type','node');
     28                        self.vpartition=project3d(md,'vector',self.vpartition','type','node');
     29                        self.epartition=project3d(md,'vector',self.epartition','type','element');
    2830                end % }}}
    2931                function self = qmu(varargin) % {{{
     
    6163                                end
    6264                                if mod(md.cluster.np-1,self.params.processors_per_evaluation),
    63                                         md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
    64                                 end
    65                         end
    66                         if ~isempty(md.qmu.partition),
    67                                 if (numel(md.qmu.partition)~=md.mesh.numberofvertices & numel(md.qmu.partition)~=md.mesh.numberofelements) | size(md.qmu.partition,2)~=1,
    68                                         md = checkmessage(md,['user supplied partition for qmu analysis should have size md.mesh.numberofvertices x 1 or md.mesh.numberofelements x 1']);
    69                                 end
    70                                 if min(md.qmu.partition)~=0,
    71                                         md = checkmessage(md,['partition vector not indexed from 0 on']);
    72                                 end
    73                                 if max(md.qmu.partition)>=md.qmu.numberofpartitions,
    74                                         md = checkmessage(md,['for qmu analysis, partitioning vector cannot go over npart, number of partition areas']);
    75                                 end
    76                         end
    77 
     65                                        %md = checkmessage(md,['in parallel library mode, the requirement is for md.cluster.np = md.qmu.params.processors_per_evaluation * number_of_slaves, where number_of_slaves will automatically be determined by Dakota. Modify md.cluster.np accordingly']);
     66                                end
     67                        end
     68                        if ~isempty(md.qmu.vpartition),
     69                                if numel(md.qmu.vpartition)~=md.mesh.numberofvertices
     70                                        md = checkmessage(md,['user supplied vertex partition for qmu analysis should have size md.mesh.numberofvertices x 1']);
     71                                end
     72                                if min(md.qmu.vpartition)~=0,
     73                                        md = checkmessage(md,['vertex partition vector not indexed from 0 on']);
     74                                end
     75                                if max(md.qmu.vpartition)>=md.qmu.numberofpartitions,
     76                                        md = checkmessage(md,['for qmu analysis, vertex partitioning vector cannot go over npart, number of partition areas']);
     77                                end
     78                        end
     79                        if ~isempty(md.qmu.epartition),
     80                                if numel(md.qmu.epartition)~=md.mesh.numberofelements,
     81                                        md = checkmessage(md,['user supplied element partition for qmu analysis should have size md.mesh.numberofelements x 1']);
     82                                end
     83                                if min(md.qmu.epartition)~=0,
     84                                        md = checkmessage(md,['element partition vector not indexed from 0 on']);
     85                                end
     86                                if max(md.qmu.epartition)>=md.qmu.numberofpartitions,
     87                                        md = checkmessage(md,['for qmu analysis, element partitioning vector cannot go over npart, number of partition areas']);
     88                                end
     89                        end
     90                        if isempty(md.qmu.vpartition) & isempty(md.qmu.epartition),
     91                                        md = checkmessage(md,['for qmu analysis, at least one of element and partitioning vectors need to be supplied!']);
     92                        end
    7893                end % }}}
    7994                function disp(self) % {{{
     
    144159                                end
    145160                        end
    146                         fielddisplay(self,'partition','user provided mesh partitioning, defaults to metis if not specified')
     161                        fielddisplay(self,'vpartition','user provided mesh partitioning (vertex based)');
     162                        fielddisplay(self,'epartition','user provided mesh partitioning (element based)');
    147163                        fielddisplay(self,'numberofpartitions','number of partitions for semi-discrete qmu')
    148164                        fielddisplay(self,'variabledescriptors','');
     
    162178                                return;
    163179                        end
    164                         WriteData(fid,prefix,'object',self,'fieldname','partition','format','DoubleMat','mattype',2);
     180                        WriteData(fid,prefix,'object',self,'fieldname','vpartition','format','DoubleMat','mattype',2);
     181                        WriteData(fid,prefix,'object',self,'fieldname','epartition','format','DoubleMat','mattype',2);
    165182                        WriteData(fid,prefix,'object',self,'fieldname','numberofpartitions','format','Integer');
    166183                        WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer');
Note: See TracChangeset for help on using the changeset viewer.