Changeset 5114


Ignore:
Timestamp:
08/10/10 09:46:18 (15 years ago)
Author:
Eric.Larour
Message:

New, totally dynamic number of dofs per node, yeehah.... Lots of debugging, especially in DistributeNumDofs, the most critical routine

Location:
issm/trunk/src
Files:
1 added
2 deleted
49 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/Container/Nodes.cpp

    r5057 r5114  
    4444/*Numerics*/
    4545/*FUNCTION Nodes::DistributeDofs{{{1*/
    46 void  Nodes::DistributeDofs(int numberofobjects,int numberofdofsperobject,int analysis_type){
     46void  Nodes::DistributeDofs(int analysis_type){
    4747
    4848        extern int num_procs;
     
    5252       
    5353        int  dofcount=0;
     54        int  maxdofspernode=0;
    5455        int* alldofcount=NULL;
    5556        int* truedofs=NULL;
    5657        int* alltruedofs=NULL;
    57 
    58         /*Go through objects, and distribute dofs locally, from 0 to numberofdofsperobject: */
     58        int  numnodes=0;
     59
     60        /*Go through objects, and distribute dofs locally, from 0 to numberofdofs: */
    5961        for (i=0;i<this->Size();i++){
    6062                Node* node=(Node*)this->GetObjectByOffset(i);
     
    6567                }
    6668        }
     69
     70
    6771
    6872        /*Ok, now every object has distributed dofs, but locally, and with a dof count starting from
     
    8690        }
    8791
    88 
    8992        /*Ok, now every cpu knows where his dofs should start. Update the dof count: */
    9093        for (i=0;i<this->Size();i++){
     
    101104         * object that is not a clone, tell them to show their dofs, so that later on, they can get picked
    102105         * up by their clones: */
    103         truedofs=(int*)xcalloc(numberofobjects*numberofdofsperobject,sizeof(int));
    104         alltruedofs=(int*)xcalloc(numberofobjects*numberofdofsperobject,sizeof(int));
     106        maxdofspernode=this->MaxNumDofs(analysis_type);
     107        numnodes=this->NumberOfNodes(analysis_type);
     108
     109        truedofs=(int*)xcalloc(numnodes*maxdofspernode,sizeof(int)); //initialize to 0, so that we can pick up the max
     110        alltruedofs=(int*)xcalloc(numnodes*maxdofspernode,sizeof(int));
    105111
    106112        for (i=0;i<this->Size();i++){
     
    108114                Node* node=(Node*)this->GetObjectByOffset(i);
    109115                if (node->InAnalysis(analysis_type)){
    110                         node->ShowTrueDofs(truedofs);
    111                 }
    112         }
    113        
    114         MPI_Allreduce ( (void*)truedofs,(void*)alltruedofs,numberofobjects*numberofdofsperobject,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     116                        node->ShowTrueDofs(truedofs,maxdofspernode);//give maxdofspernode, column size, so that nodes can index into truedofs
     117                }
     118        }
     119
     120        MPI_Allreduce ( (void*)truedofs,(void*)alltruedofs,numnodes*maxdofspernode,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
    115121
    116122        /*Ok, now every cpu knows the true dofs of everyone else that is not a clone. Let the clones recover those true dofs: */
     
    119125                Node* node=(Node*)this->GetObjectByOffset(i);
    120126                if (node->InAnalysis(analysis_type)){
    121                         node->UpdateCloneDofs(alltruedofs);
     127                        node->UpdateCloneDofs(alltruedofs,maxdofspernode); //give maxdofspernode, column size, so that nodes can index into alltruedofs
    122128                }
    123129        }
     
    128134        xfree((void**)&alltruedofs);
    129135
     136
    130137}
    131138/*}}}*/
    132139/*FUNCTION Nodes::FlagClones{{{1*/
    133 void  Nodes::FlagClones(int numberofobjects,int analysis_type){
     140void  Nodes::FlagClones(int analysis_type){
    134141
    135142        int i;
     
    138145        int* ranks=NULL;
    139146        int* minranks=NULL;
     147        int  numnodes;
     148
     149
     150        /*Figure out number of nodes for this analysis: */
     151        numnodes=this->NumberOfNodes(analysis_type);
    140152
    141153        /*Allocate ranks: */
    142         ranks=(int*)xmalloc(numberofobjects*sizeof(int));
    143         minranks=(int*)xmalloc(numberofobjects*sizeof(int));
    144 
    145         for(i=0;i<numberofobjects;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
     154        ranks=(int*)xmalloc(numnodes*sizeof(int));
     155        minranks=(int*)xmalloc(numnodes*sizeof(int));
     156
     157        for(i=0;i<numnodes;i++)ranks[i]=num_procs; //no cpu can have rank num_procs. This is the maximum limit.
    146158
    147159        /*Now go through all our objects and ask them to report to who they belong (which rank): */
     
    152164         * dealt with by another cpu. We take the minimum because we are going to manage dof assignment in increasing
    153165         * order of cpu rank. This is also why we initialized this array to num_procs.*/
    154         MPI_Allreduce ( (void*)ranks,(void*)minranks,numberofobjects,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
     166        MPI_Allreduce ( (void*)ranks,(void*)minranks,numnodes,MPI_INT,MPI_MIN,MPI_COMM_WORLD);
    155167
    156168        /*Now go through all objects, and use minranks to flag which objects are cloned: */
     
    236248int Nodes::NumberOfNodes(void){
    237249
     250        /*Careful! only use once all clones have been setup for all nodes!: */
     251
    238252        int i;
    239253       
     
    260274        int i;
    261275
    262         int max_sid=0;
     276        int max_sid=-1;
    263277        int sid;
    264278        int node_max_sid;
     
    276290        }
    277291
    278 #ifdef _PARALLEL_
    279         MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
    280         MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
    281         max_sid=node_max_sid;
    282 #endif
    283 
    284         /*sid starts at 0*/
    285         max_sid++;
    286 
    287         /*return*/
    288         return max_sid;
     292        #ifdef _PARALLEL_
     293                MPI_Reduce (&max_sid,&node_max_sid,1,MPI_INT,MPI_MAX,0,MPI_COMM_WORLD );
     294                MPI_Bcast(&node_max_sid,1,MPI_INT,0,MPI_COMM_WORLD);
     295                max_sid=node_max_sid;
     296        #endif
     297
     298        if(max_sid==1){
     299                return 0;
     300        }
     301        else{
     302                /*sid starts at 0*/
     303                max_sid++;
     304       
     305                /*return*/
     306                return max_sid;
     307        }
    289308}
    290309/*}}}*/
     
    315334}
    316335/*}}}*/
     336/*FUNCTION Nodes::MaxNumDofs{{{1*/
     337int   Nodes::MaxNumDofs(int analysis_type){
     338
     339        int i;
     340        int   max=0;
     341        int   allmax;
     342        int   numdofs=0;
     343
     344        /*Now go through all nodes, and get how many dofs they own, unless they are clone nodes: */
     345        for(i=0;i<this->Size();i++){
     346
     347                Node* node=(Node*)this->GetObjectByOffset(i);
     348
     349                /*Check that this node corresponds to our analysis currently being carried out: */
     350                if (node->InAnalysis(analysis_type)){
     351
     352                        numdofs=node->GetNumberOfDofs();
     353                        if (numdofs>max)max=numdofs;
     354                }
     355        }
     356
     357        #ifdef _PARALLEL_
     358        /*Grab max of all cpus: */
     359        MPI_Allreduce ( (void*)&max,(void*)&allmax,1,MPI_INT,MPI_MAX,MPI_COMM_WORLD);
     360        max=allmax;
     361        #endif
     362
     363        return max;
     364}
     365/*}}}*/
  • issm/trunk/src/c/Container/Nodes.h

    r5057 r5114  
    1919                /*}}}*/
    2020                /*numerics: {{{1*/
    21                 void  DistributeDofs(int numberofnodes,int numdofspernode,int analysis_type);
    22                 void  FlagClones(int numberofnodes,int analysis_type);
     21                void  DistributeDofs(int analysis_type);
     22                void  FlagClones(int analysis_type);
    2323                void  FlagNodeSets(Vec pv_g, Vec pv_f, Vec pv_s,int analysis_type);
    2424                int   NumberOfDofs(int analysis_type);
     
    2626                int   NumberOfNodes(void);
    2727                void  Ranks(int* ranks,int analysis_type);
     28                int   MaxNumDofs(int analysis_type);
    2829                /*}}}*/
    2930
  • issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h

    r5103 r5114  
    321321        NumOutputEnum,
    322322        NumRiftsEnum,
    323         NumberOfDofsPerNodeEnum,
    324323        NumberOfElementsEnum,
    325324        NumberOfNodesEnum,
  • issm/trunk/src/c/EnumDefinitions/EnumToString.cpp

    r5103 r5114  
    284284                case NumOutputEnum : return "NumOutput";
    285285                case NumRiftsEnum : return "NumRifts";
    286                 case NumberOfDofsPerNodeEnum : return "NumberOfDofsPerNode";
    287286                case NumberOfElementsEnum : return "NumberOfElements";
    288287                case NumberOfNodesEnum : return "NumberOfNodes";
  • issm/trunk/src/c/EnumDefinitions/StringToEnum.cpp

    r5103 r5114  
    282282        else if (strcmp(name,"NumOutput")==0) return NumOutputEnum;
    283283        else if (strcmp(name,"NumRifts")==0) return NumRiftsEnum;
    284         else if (strcmp(name,"NumberOfDofsPerNode")==0) return NumberOfDofsPerNodeEnum;
    285284        else if (strcmp(name,"NumberOfElements")==0) return NumberOfElementsEnum;
    286285        else if (strcmp(name,"NumberOfNodes")==0) return NumberOfNodesEnum;
  • issm/trunk/src/c/Makefile.am

    r5103 r5114  
    233233                                        ./shared/Dofs/dofs.h\
    234234                                        ./shared/Dofs/dofsetgen.cpp\
    235                                         ./shared/Dofs/DistributeNumDofs.cpp\
    236235                                        ./shared/Numerics/numerics.h\
    237236                                        ./shared/Numerics/isnan.h\
     
    340339                                        ./modules/ModelProcessorx/ModelProcessorx.h\
    341340                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
     341                                        ./modules/ModelProcessorx/DistributeNumDofs.cpp\
    342342                                        ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\
    343343                                        ./modules/ModelProcessorx/NodesPartitioning.cpp\
     
    768768                                        ./shared/Dofs/dofs.h\
    769769                                        ./shared/Dofs/dofsetgen.cpp\
    770                                         ./shared/Dofs/DistributeNumDofs.cpp\
    771770                                        ./shared/Numerics/numerics.h\
    772771                                        ./shared/Numerics/IsInputConverged.cpp\
     
    872871                                        ./modules/ModelProcessorx/ModelProcessorx.h\
    873872                                        ./modules/ModelProcessorx/ModelProcessorx.cpp\
     873                                        ./modules/ModelProcessorx/DistributeNumDofs.cpp\
    874874                                        ./modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp\
    875875                                        ./modules/ModelProcessorx/NodesPartitioning.cpp\
  • issm/trunk/src/c/modules/ModelProcessorx/Balancedthickness/CreateNodesBalancedthickness.cpp

    r4983 r5114  
    4747        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4848        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     49        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4950
    5051        if(continuous_galerkin){
     
    9293        xfree((void**)&iomodel->gridonicesheet);
    9394        xfree((void**)&iomodel->gridoniceshelf);
     95        xfree((void**)&iomodel->vertices_type);
    9496
    9597        /*Assign output pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Balancedvelocities/CreateNodesBalancedvelocities.cpp

    r4983 r5114  
    3939        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4040        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    41 
     41        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4242        for (i=0;i<iomodel->numberofvertices;i++){
    4343
     
    5656        xfree((void**)&iomodel->gridonicesheet);
    5757        xfree((void**)&iomodel->gridoniceshelf);
    58        
     58        xfree((void**)&iomodel->vertices_type);
     59
    5960        /*Assign output pointer: */
    6061        *pnodes=nodes;
  • issm/trunk/src/c/modules/ModelProcessorx/BedSlope/CreateNodesBedSlope.cpp

    r4983 r5114  
    3939        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4040        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     41        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4142
    4243        for (i=0;i<iomodel->numberofvertices;i++){
     
    5657        xfree((void**)&iomodel->gridonicesheet);
    5758        xfree((void**)&iomodel->gridoniceshelf);
     59        xfree((void**)&iomodel->vertices_type);
    5860       
    5961        /*Assign output pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r5043 r5114  
    1717       
    1818        Parameters* parameters = NULL;
    19         int      numberofdofspernode;
    2019        char**   parameteroutput=NULL;
    2120        char*    descriptor=NULL;
     
    6766
    6867        /*Deal with more complex parameters*/
    69         DistributeNumDofs(&numberofdofspernode,analysis_type);
    70         parameters->AddObject(new IntParam(NumberOfDofsPerNodeEnum,numberofdofspernode));
    71 
    7268        IoModelFetchData(&iomodel->riftinfo,&iomodel->numrifts,NULL,iomodel_handle,"riftinfo");
    7369        parameters->AddObject(new IntParam(NumRiftsEnum,iomodel->numrifts));
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateNodesDiagnosticHoriz.cpp

    r4983 r5114  
    4040        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4141        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     42        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4243        if (iomodel->dim==3){
    4344                IoModelFetchData(&iomodel->deadgrids,NULL,NULL,iomodel_handle,"deadgrids");
     
    6061        xfree((void**)&iomodel->gridoniceshelf);
    6162        xfree((void**)&iomodel->deadgrids);
     63        xfree((void**)&iomodel->vertices_type);
    6264
    6365        cleanup_and_return:
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateNodesDiagnosticHutter.cpp

    r4983 r5114  
    4444        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
    4545        IoModelFetchData(&iomodel->elements,NULL,NULL,iomodel_handle,"elements");
     46        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
     47
    4648        CreateNumberNodeToElementConnectivity(iomodel);
    4749
     
    6567        xfree((void**)&iomodel->elements);
    6668        xfree((void**)&iomodel->numbernodetoelementconnectivity);
     69        xfree((void**)&iomodel->vertices_type);
    6770
    6871        cleanup_and_return:
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticStokes/CreateNodesDiagnosticStokes.cpp

    r4983 r5114  
    4343        IoModelFetchData(&iomodel->gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
    4444        IoModelFetchData(&iomodel->borderstokes,NULL,NULL,iomodel_handle,"borderstokes");
     45        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4546
    4647        for (i=0;i<iomodel->numberofvertices;i++){
     
    6263        xfree((void**)&iomodel->gridonicesheet);
    6364        xfree((void**)&iomodel->gridoniceshelf);
     65        xfree((void**)&iomodel->vertices_type);
    6466
    6567        cleanup_and_return:
  • issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateNodesDiagnosticVert.cpp

    r4983 r5114  
    4040        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4141        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     42        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4243
    4344        for (i=0;i<iomodel->numberofvertices;i++){
     
    5758        xfree((void**)&iomodel->gridonicesheet);
    5859        xfree((void**)&iomodel->gridoniceshelf);
     60        xfree((void**)&iomodel->vertices_type);
    5961       
    6062        cleanup_and_return:
  • issm/trunk/src/c/modules/ModelProcessorx/Melting/CreateNodesMelting.cpp

    r4983 r5114  
    3939        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4040        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     41        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4142
    4243        for (i=0;i<iomodel->numberofvertices;i++){
     
    5657        xfree((void**)&iomodel->gridonicesheet);
    5758        xfree((void**)&iomodel->gridoniceshelf);
     59        xfree((void**)&iomodel->vertices_type);
    5860
    5961        /*Assign output pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/ModelProcessorx.h

    r5043 r5114  
    102102void  UpdateCounters(IoModel* iomodel,Nodes** pnodes,Loads** ploads, Constraints** pconstraints);
    103103
     104
     105/*Distribution of dofs: */
     106void DistributeNumDofs(int* pnumdofs,int analysis_type,double* vertices_type);
     107
    104108#endif
  • issm/trunk/src/c/modules/ModelProcessorx/Prognostic/CreateNodesPrognostic.cpp

    r4983 r5114  
    4747        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4848        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     49        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4950
    5051        if(continuous_galerkin){
     
    9293        xfree((void**)&iomodel->gridoniceshelf);
    9394        xfree((void**)&iomodel->elements);
     95        xfree((void**)&iomodel->vertices_type);
    9496
    9597        /*Assign output pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/SurfaceSlope/CreateNodesSurfaceSlope.cpp

    r4983 r5114  
    3939        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4040        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     41        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4142
    4243        for (i=0;i<iomodel->numberofvertices;i++){
     
    5657        xfree((void**)&iomodel->gridonicesheet);
    5758        xfree((void**)&iomodel->gridoniceshelf);
     59        xfree((void**)&iomodel->vertices_type);
    5860       
    5961        /*Assign output pointer: */
  • issm/trunk/src/c/modules/ModelProcessorx/Thermal/CreateNodesThermal.cpp

    r4983 r5114  
    3939        IoModelFetchData(&iomodel->gridonicesheet,NULL,NULL,iomodel_handle,"gridonicesheet");
    4040        IoModelFetchData(&iomodel->gridoniceshelf,NULL,NULL,iomodel_handle,"gridoniceshelf");
     41        IoModelFetchData(&iomodel->vertices_type,NULL,NULL,iomodel_handle,"vertices_type");
    4142
    4243        for (i=0;i<iomodel->numberofvertices;i++){
     
    5657        xfree((void**)&iomodel->gridonicesheet);
    5758        xfree((void**)&iomodel->gridoniceshelf);
     59        xfree((void**)&iomodel->vertices_type);
    5860       
    5961        /*Assign output pointer: */
  • issm/trunk/src/c/modules/NodesDofx/NodesDofx.cpp

    r4387 r5114  
    1616        int i;
    1717       
    18         /*intermediary: */
    19         int  numberofnodes;
    20         int  numberofdofspernode;
     18        /*Do we have any nodes for this analysis type? :*/
     19        if(nodes->NumberOfNodes(analysis_type)){
    2120
    22         /*First, recover number nodes associated th this analysis: */
    23         numberofnodes=nodes->NumberOfNodes(analysis_type);
     21                /*Ensure that only for each cpu, the partition border nodes only will be taken into account once
     22                 * across the cluster. To do so, we flag all the clone nodes: */
     23                nodes->FlagClones(analysis_type);
    2424
    25         /*Recover number of dofs per node: */
    26         found=parameters->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum);
    27         if(!found)ISSMERROR("could not find numberofdofspernode in parameters");
    28         /*WARNING: THERE IS A BUG HERE TO BE FIXED (see wiki)*/
    29         DistributeNumDofs(&numberofdofspernode,analysis_type);
     25                /*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When
     26                 *a  node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it
     27                 *anymore. Use clone field to be sure of that: */
     28                nodes->DistributeDofs(analysis_type);
    3029
    31         /*Ensure that only for each cpu, the partition border nodes only will be taken into account once
    32          * across the cluster. To do so, we flag all the clone nodes: */
    33         nodes->FlagClones(numberofnodes,analysis_type);
    34 
    35         /*Go through all nodes, and build degree of freedom lists. Each node gets a fixed number of dofs. When
    36          *a  node has already been distributed dofs on one cpu, all other cpus with the same node cannot distribute it
    37          *anymore. Use clone field to be sure of that: */
    38         nodes->DistributeDofs(numberofnodes,numberofdofspernode,analysis_type);
     30        }
    3931
    4032}
  • issm/trunk/src/c/modules/SystemMatricesx/SystemMatricesx.cpp

    r4573 r5114  
    3333        /*Recover parameters: */
    3434        parameters->FindParam(&connectivity,ConnectivityEnum);
    35         parameters->FindParam(&numberofdofspernode,NumberOfDofsPerNodeEnum);
    3635
    3736        /*Get size of matrix: */
    3837        gsize=nodes->NumberOfDofs(configuration_type);
     38
     39        /*Get numberofdofspernode: */
     40        numberofdofspernode=nodes->MaxNumDofs(analysis_type);
    3941
    4042        /*Compute stiffness matrix*/
     
    8486                VecAssemblyEnd(pg);
    8587        }
     88
    8689       
    8790        /*Assign output pointers: */
  • issm/trunk/src/c/objects/DofIndexing.cpp

    r5109 r5114  
    5353/*}}}*/
    5454/*FUNCTION DofIndexing::~DofIndexing() {{{1*/
    55 DofIndexing::~DofIndexing(){
    56 
    57         xfree((void**)&f_set);
    58         xfree((void**)&s_set);
    59         xfree((void**)&doflist);
     55DofIndexing::~DofIndexing(){ //destructor
    6056}
    6157/*}}}*/
  • issm/trunk/src/c/objects/Node.cpp

    r5103 r5114  
    1717#include "../shared/shared.h"
    1818#include "../include/include.h"
     19#include "../modules/modules.h"
    1920/*}}}*/
    2021
     
    7071
    7172        /*indexing:*/
    72         DistributeNumDofs(&numdofs,analysis_type); //number of dofs per node
     73        DistributeNumDofs(&numdofs,analysis_type,iomodel->vertices_type+2*io_index); //number of dofs per node
    7374        this->indexing.Init(numdofs);
    7475
     
    190191        hvertex->DeepEcho();
    191192        printf("   inputs\n");
    192         inputs->DeepEcho();
     193
    193194
    194195}
     
    630631/*}}}*/
    631632/*FUNCTION Node::ShowTrueDofs{{{1*/
    632 void  Node::ShowTrueDofs(int* truedofs){
     633void  Node::ShowTrueDofs(int* truedofs, int ncols){
    633634
    634635        int j;
     
    640641        /*Ok, we are not a clone, just plug our dofs into truedofs: */
    641642        for(j=0;j<this->indexing.numberofdofs;j++){
    642                 *(truedofs+this->indexing.numberofdofs*sid+j)=indexing.doflist[j];
    643         }
    644 
     643                *(truedofs+ncols*sid+j)=indexing.doflist[j];
     644        }
    645645}
    646646/*}}}*/
    647647/*FUNCTION Node::UpdateCloneDofs{{{1*/
    648 void  Node::UpdateCloneDofs(int* alltruedofs){
     648void  Node::UpdateCloneDofs(int* alltruedofs,int ncols){
    649649
    650650        int j;
     
    654654        if(indexing.clone==0)return;
    655655
    656         /*Ok, we are a clone node, but we did not create the dofs for this node.
    657          * Therefore, our doflist is garbage right now. Go pick it up in the alltruedofs: */
     656
     657        /*Ok, we are a clone node, but we did not create the dofs for this node.
     658         *      * Therefore, our doflist is garbage right now. Go pick it up in the alltruedofs: */
    658659        for(j=0;j<this->indexing.numberofdofs;j++){
    659                 indexing.doflist[j]=*(alltruedofs+this->indexing.numberofdofs*sid+j);
    660         }
     660                indexing.doflist[j]=*(alltruedofs+ncols*sid+j);
     661        }
     662
    661663}
    662664/*}}}*/
  • issm/trunk/src/c/objects/Node.h

    r5096 r5114  
    9090                void  DistributeDofs(int* pdofcount);
    9191                void  OffsetDofs(int dofcount);
    92                 void  ShowTrueDofs(int* borderdofs);
    93                 void  UpdateCloneDofs(int* allborderdofs);
     92                void  ShowTrueDofs(int* truerows,int ncols);
     93                void  UpdateCloneDofs(int* alltruerows,int ncols);
    9494                void  SetClone(int* minranks);
    9595                void  CreatePartition(Vec partition);
  • issm/trunk/src/c/shared/Dofs/dofs.h

    r4021 r5114  
    77
    88double* dofsetgen(int numdofs,int* doflist,int dofspernode,int totaldofs);
    9 int DistributeNumDofs(int *pnumdofs,int analysis_type);
    109
    1110
  • issm/trunk/src/m/enum/EnumToString.m

    r5103 r5114  
    279279        case NumOutputEnum(), string='NumOutput'; return
    280280        case NumRiftsEnum(), string='NumRifts'; return
    281         case NumberOfDofsPerNodeEnum(), string='NumberOfDofsPerNode'; return
    282281        case NumberOfElementsEnum(), string='NumberOfElements'; return
    283282        case NumberOfNodesEnum(), string='NumberOfNodes'; return
  • issm/trunk/src/m/enum/NumberOfElementsEnum.m

    r5066 r5114  
    99%      macro=NumberOfElementsEnum()
    1010
    11 macro=269;
     11macro=268;
  • issm/trunk/src/m/enum/NumberOfNodesEnum.m

    r5066 r5114  
    99%      macro=NumberOfNodesEnum()
    1010
    11 macro=270;
     11macro=269;
  • issm/trunk/src/m/enum/NumberOfVerticesEnum.m

    r5066 r5114  
    99%      macro=NumberOfVerticesEnum()
    1010
    11 macro=271;
     11macro=270;
  • issm/trunk/src/m/enum/OptScalEnum.m

    r5066 r5114  
    99%      macro=OptScalEnum()
    1010
    11 macro=272;
     11macro=271;
  • issm/trunk/src/m/enum/OutputFilePointerEnum.m

    r5066 r5114  
    99%      macro=OutputFilePointerEnum()
    1010
    11 macro=273;
     11macro=272;
  • issm/trunk/src/m/enum/ParameterOutputEnum.m

    r5066 r5114  
    99%      macro=ParameterOutputEnum()
    1010
    11 macro=274;
     11macro=273;
  • issm/trunk/src/m/enum/PenaltyMeltingEnum.m

    r5066 r5114  
    99%      macro=PenaltyMeltingEnum()
    1010
    11 macro=275;
     11macro=274;
  • issm/trunk/src/m/enum/QmuAnalysisEnum.m

    r5066 r5114  
    99%      macro=QmuAnalysisEnum()
    1010
    11 macro=276;
     11macro=275;
  • issm/trunk/src/m/enum/QmuErrNameEnum.m

    r5066 r5114  
    99%      macro=QmuErrNameEnum()
    1010
    11 macro=277;
     11macro=276;
  • issm/trunk/src/m/enum/QmuInNameEnum.m

    r5066 r5114  
    99%      macro=QmuInNameEnum()
    1010
    11 macro=278;
     11macro=277;
  • issm/trunk/src/m/enum/QmuMassFluxSegmentsEnum.m

    r5066 r5114  
    99%      macro=QmuMassFluxSegmentsEnum()
    1010
    11 macro=279;
     11macro=278;
  • issm/trunk/src/m/enum/QmuNPartEnum.m

    r5066 r5114  
    99%      macro=QmuNPartEnum()
    1010
    11 macro=280;
     11macro=279;
  • issm/trunk/src/m/enum/QmuOutNameEnum.m

    r5066 r5114  
    99%      macro=QmuOutNameEnum()
    1010
    11 macro=281;
     11macro=280;
  • issm/trunk/src/m/enum/QmuPartEnum.m

    r5066 r5114  
    99%      macro=QmuPartEnum()
    1010
    11 macro=282;
     11macro=281;
  • issm/trunk/src/m/enum/ResponseDescriptorsEnum.m

    r5066 r5114  
    99%      macro=ResponseDescriptorsEnum()
    1010
    11 macro=283;
     11macro=282;
  • issm/trunk/src/m/enum/SolverStringEnum.m

    r5066 r5114  
    99%      macro=SolverStringEnum()
    1010
    11 macro=284;
     11macro=283;
  • issm/trunk/src/m/enum/SparsityEnum.m

    r5066 r5114  
    99%      macro=SparsityEnum()
    1010
    11 macro=285;
     11macro=284;
  • issm/trunk/src/m/enum/StringToEnum.m

    r5103 r5114  
    277277elseif (strcmpi(name,'NumOutput')), enum=NumOutputEnum(); return
    278278elseif (strcmpi(name,'NumRifts')), enum=NumRiftsEnum(); return
    279 elseif (strcmpi(name,'NumberOfDofsPerNode')), enum=NumberOfDofsPerNodeEnum(); return
    280279elseif (strcmpi(name,'NumberOfElements')), enum=NumberOfElementsEnum(); return
    281280elseif (strcmpi(name,'NumberOfNodes')), enum=NumberOfNodesEnum(); return
  • issm/trunk/src/m/enum/TolXEnum.m

    r5066 r5114  
    99%      macro=TolXEnum()
    1010
    11 macro=286;
     11macro=285;
  • issm/trunk/src/m/enum/VariableDescriptorsEnum.m

    r5066 r5114  
    99%      macro=VariableDescriptorsEnum()
    1010
    11 macro=287;
     11macro=286;
  • issm/trunk/src/m/enum/VerboseEnum.m

    r5066 r5114  
    99%      macro=VerboseEnum()
    1010
    11 macro=288;
     11macro=287;
  • issm/trunk/src/m/enum/WaitOnLockEnum.m

    r5066 r5114  
    99%      macro=WaitOnLockEnum()
    1010
    11 macro=289;
     11macro=288;
  • issm/trunk/src/m/enum/YtsEnum.m

    r5066 r5114  
    99%      macro=YtsEnum()
    1010
    11 macro=290;
     11macro=289;
Note: See TracChangeset for help on using the changeset viewer.