Ignore:
Timestamp:
03/23/21 11:52:52 (4 years ago)
Author:
Mathieu Morlighem
Message:

CHG: big simplification here: we now carry the vectors of fset and sset using the same size as gset, with -1 when they are not in the right set. Example: old_fset = [1 2 3], new_fset=[1 -1 2 3 -1 -1]; enjoy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r26073 r26131  
    947947        /*First, figure out size of doflist and create it: */
    948948        int numberofdofs=0;
    949         for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
     949        for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
    950950
    951951        /*Allocate output*/
     
    955955        int count=0;
    956956        for(int i=0;i<numnodes;i++){
    957                 nodes[i]->GetDofList(doflist+count,approximation_enum,setenum);
    958                 count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
     957                nodes[i]->GetDofList(&doflist[count],approximation_enum,setenum);
     958                count+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
    959959        }
    960960
     
    970970        /*First, figure out size of doflist and create it: */
    971971        int numberofdofs=0;
    972         for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
     972        for(int i=0;i<numnodes;i++) numberofdofs+=nodes[i]->GetNumberOfDofs(NoneApproximationEnum,GsetEnum);
    973973
    974974        /*Allocate output*/
     
    978978        int count=0;
    979979        for(int i=0;i<numnodes;i++){
     980                _assert_(count<numberofdofs);
    980981                nodes[i]->GetDofListLocal(doflist+count,approximation_enum,setenum);
    981                 count+=nodes[i]->GetNumberOfDofs(approximation_enum,setenum);
     982                count+=nodes[i]->GetNumberOfDofs(approximation_enum,GsetEnum);
    982983        }
    983984
     
    43734374
    43744375        /*Copy current stiffness matrix*/
    4375         values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
    4376         for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->ncols;j++) values[i*Ke->ncols+j]=Ke->values[i*Ke->ncols+j];
     4376        values=xNew<IssmDouble>(Ke->nrows*Ke->nrows);
     4377        for(i=0;i<Ke->nrows;i++) for(j=0;j<Ke->nrows;j++) values[i*Ke->nrows+j]=Ke->values[i*Ke->nrows+j];
    43774378
    43784379        /*Get Coordinate Systems transform matrix*/
     
    43814382        /*Transform matrix: R*Ke*R^T */
    43824383        TripleMultiply(transform,numdofs,numdofs,0,
    4383                                 values,Ke->nrows,Ke->ncols,0,
     4384                                values,Ke->nrows,Ke->nrows,0,
    43844385                                transform,numdofs,numdofs,1,
    43854386                                &Ke->values[0],0);
     
    45494550
    45504551        /*Copy current stiffness matrix*/
    4551         values=xNew<IssmDouble>(Ke->nrows*Ke->ncols);
    4552         for(int i=0;i<Ke->nrows*Ke->ncols;i++) values[i]=Ke->values[i];
     4552        values=xNew<IssmDouble>(Ke->nrows*Ke->nrows);
     4553        for(int i=0;i<Ke->nrows*Ke->nrows;i++) values[i]=Ke->values[i];
    45534554
    45544555        /*Get Coordinate Systems transform matrix*/
     
    45574558        /*Transform matrix: R^T*Ke*R */
    45584559        TripleMultiply(transform,numdofs,numdofs,1,
    4559                                 values,Ke->nrows,Ke->ncols,0,
     4560                                values,Ke->nrows,Ke->nrows,0,
    45604561                                transform,numdofs,numdofs,0,
    45614562                                &Ke->values[0],0);
Note: See TracChangeset for help on using the changeset viewer.