Changeset 26917


Ignore:
Timestamp:
03/08/22 10:16:44 (3 years ago)
Author:
Mathieu Morlighem
Message:

CHG: new way to detect whether a dof is in a stiffness matrix

Location:
issm/trunk-jpl/src/c/classes/matrix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.cpp

    r26144 r26917  
    260260        _printf_("   sglobaldoflist  (" << sglobaldoflist << "): ");
    261261        for(i=0;i<nrows;i++)_printf_(" " << sglobaldoflist[i]); _printf_(" \n");
     262}
     263/*}}}*/
     264bool ElementMatrix::HasDof(int dof,int set){/*{{{*/
     265
     266        if(set==FsetEnum){
     267                for(int i=0;i<this->nrows;i++) if(this->fglobaldoflist[i] == dof) return true;
     268        }
     269        else if(set==GsetEnum){
     270                for(int i=0;i<this->nrows;i++) if(this->gglobaldoflist[i] == dof) return true;
     271        }
     272        else if(set==SsetEnum){
     273                for(int i=0;i<this->nrows;i++) if(this->sglobaldoflist[i] == dof) return true;
     274        }
     275        else{
     276                _error_("not supported yet");
     277        }
     278
     279        return false;
    262280}
    263281/*}}}*/
  • issm/trunk-jpl/src/c/classes/matrix/ElementMatrix.h

    r26144 r26917  
    4646                void StaticCondensation(int numindices,int* indices);
    4747                void Transpose(void);
     48                bool HasDof(int dof,int set);
    4849};
    4950#endif //#ifndef _ELEMENT_MATRIX_H_
Note: See TracChangeset for help on using the changeset viewer.