Changeset 15198


Ignore:
Timestamp:
06/06/13 10:35:32 (12 years ago)
Author:
Mathieu Morlighem
Message:

NEW: Added active field in node for node activation/deactivation

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

Legend:

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

    r15104 r15198  
    2727        this->ssize    = UNDEF;
    2828        this->clone    = false;
     29        this->active   = true;
    2930        this->f_set    = NULL;
    3031        this->s_set    = NULL;
     
    4748DofIndexing::DofIndexing(DofIndexing* in){ //copy constructor
    4849
    49         this->gsize = in->gsize;
    50         this->fsize = in->fsize;
    51         this->ssize = in->ssize;
    52         this->clone = in->clone;
     50        this->gsize  = in->gsize;
     51        this->fsize  = in->fsize;
     52        this->ssize  = in->ssize;
     53        this->clone  = in->clone;
     54        this->active = in->active;
    5355
    5456        if(this->gsize>0){
     
    158160}
    159161/*}}}*/
     162/*FUNCTION DofIndexing::Deactivate{{{*/
     163void DofIndexing::Deactivate(void){
     164        this->active = false;
     165
     166        /*Constrain to 0. at this point*/
     167        for(int i=0;i<this->gsize;i++){
     168                this->f_set[i]    = false;
     169                this->s_set[i]    = true;
     170                this->svalues[i]  = 0.;
     171        }
     172        return;
     173}
     174/*}}}*/
    160175
    161176/*Some of the Object functionality: */
     
    164179
    165180        _printf_("DofIndexing:\n");
    166         _printf_("   gsize: " << gsize << "\n");
    167         _printf_("   clone: " << clone << "\n");
     181        _printf_("   gsize:  " << gsize << "\n");
     182        _printf_("   clone:  " << clone << "\n");
     183        _printf_("   active: " << active << "\n");
    168184}
    169185/*}}}*/
     
    174190
    175191        _printf_("DofIndexing:\n");
    176         _printf_("   gsize: " << gsize << "\n");
    177         _printf_("   fsize: " << fsize << "\n");
    178         _printf_("   ssize: " << ssize << "\n");
    179         _printf_("   clone: " << clone << "\n");
     192        _printf_("   gsize:  " << gsize << "\n");
     193        _printf_("   fsize:  " << fsize << "\n");
     194        _printf_("   ssize:  " << ssize << "\n");
     195        _printf_("   clone:  " << clone << "\n");
     196        _printf_("   active: " << active << "\n");
    180197
    181198        _printf_("   set membership: f,s sets \n");
  • issm/trunk-jpl/src/c/classes/DofIndexing.h

    r14915 r15198  
    44
    55#ifndef _DOFINDEXING_H_
    6 #define  _DOFINDEXING_H_
     6#define _DOFINDEXING_H_
    77
    88#include "../shared/Numerics/types.h"
     
    1919                /*partitioning: */
    2020                bool clone;   //this node is replicated from another one
     21                bool active;  //Is this node active or inactive (all dofs are constrained)
    2122
    2223                /*boundary conditions sets: */
     
    4849                /*DofIndexing management: {{{*/
    4950                DofIndexing* Spawn(int* indices, int numindices);
     51                void Deactivate(void);
    5052                /*}}}*/
    5153
  • issm/trunk-jpl/src/c/classes/Node.cpp

    r15104 r15198  
    6868        if (!iomodel->Data(MaskVertexonwaterEnum)) _error_("iomodel->nodeonwater is NULL");
    6969        if (reCast<bool>(iomodel->Data(MaskVertexonwaterEnum)[io_index])){
    70                 for(k=1;k<=gsize;k++){
    71                         this->FreezeDof(k);
    72                 }
     70                this->Deactivate();
    7371        }
    7472
     
    8684                        _assert_(iomodel->Data(FlowequationVertexEquationEnum));
    8785                        if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
    88                                 for(k=1;k<=gsize;k++) this->FreezeDof(k);
     86                                this->Deactivate();
    8987                        }
    9088                        if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==L1L2ApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
    91                                 for(k=1;k<=gsize;k++) this->FreezeDof(k);
     89                                this->Deactivate();
    9290                        }
    9391                        if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==MacAyealPattynApproximationEnum && reCast<int>(iomodel->Data(FlowequationBordermacayealEnum)[io_index])){
    9492                                if(!reCast<int>(iomodel->Data(MeshVertexonbedEnum)[io_index])){
    95                                         for(k=1;k<=gsize;k++) this->FreezeDof(k);
     93                                        this->Deactivate();
    9694                                }
    9795                        }
     
    104102                /*spc all nodes on hutter*/
    105103                if (iomodel->Data(FlowequationVertexEquationEnum)[io_index]==HutterApproximationEnum){
    106                         for(k=1;k<=gsize;k++){
    107                                 this->FreezeDof(k);
    108                         }
     104                        this->Deactivate();
    109105                }
    110106        }
     
    116112                /*Constrain all nodes that are not Hutter*/
    117113                if (reCast<int>(iomodel->Data(FlowequationVertexEquationEnum)[io_index])!=HutterApproximationEnum){
    118                         for(k=1;k<=gsize;k++){
    119                                 this->FreezeDof(k);
    120                         }
     114                        this->Deactivate();
    121115                }
    122116        }
     
    134128                        _assert_(iomodel->Data(MeshVertexonbedEnum));
    135129                        if (!(reCast<bool>(iomodel->Data(MeshVertexonbedEnum)[io_index]))){
    136                                 for(k=1;k<=gsize;k++){
    137                                         this->FreezeDof(k);
    138                                 }
     130                                this->Deactivate();
    139131                        }
    140132                }
     
    497489
    498490        DofInSSet(dof-1); //with 0 displacement for this dof.
     491
     492}
     493/*}}}*/
     494/*FUNCTION Node::Deactivate{{{*/
     495void  Node::Deactivate(void){
     496
     497        indexing.Deactivate();
    499498
    500499}
  • issm/trunk-jpl/src/c/classes/Node.h

    r15067 r15198  
    8787                void   GetLocalDofList(int* poutdoflist,int approximation_enum,int setenum);
    8888                void   FreezeDof(int dof);
     89                void   Deactivate(void);
    8990                int    IsFloating();
    9091                int    IsGrounded();
Note: See TracChangeset for help on using the changeset viewer.