Changeset 20462


Ignore:
Timestamp:
04/07/16 14:55:28 (9 years ago)
Author:
Mathieu Morlighem
Message:

BUG: added freeze field to dofindexing, if we run in 2d and not in 3d, it is not the job of SetActiveNodesLSMx to figure out whether it can activate or not a node that is not on the basal layer. The node should know better

Location:
issm/trunk-jpl/src/c
Files:
6 edited

Legend:

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

    r19255 r20462  
    2828        this->clone    = false;
    2929        this->active   = true;
     30        this->freeze   = false;
    3031        this->f_set    = NULL;
    3132        this->s_set    = NULL;
     
    5152        this->clone  = in->clone;
    5253        this->active = in->active;
     54        this->freeze = in->freeze;
    5355
    5456        if(this->gsize>0){
     
    112114        this->clone  = in.clone;
    113115        this->active = in.active;
     116        this->freeze = in.freeze;
    114117
    115118        if(this->gsize>0){
     
    219222        _printf_("   clone:  " << clone << "\n");
    220223        _printf_("   active: " << active << "\n");
     224        _printf_("   freeze: " << freeze << "\n");
    221225}
    222226/*}}}*/
     
    231235        _printf_("   clone:  " << clone << "\n");
    232236        _printf_("   active: " << active << "\n");
     237        _printf_("   freeze: " << freeze << "\n");
    233238
    234239        _printf_("   set membership: f,s sets \n");
     
    284289/*}}}*/
    285290void DofIndexing::Activate(void){/*{{{*/
     291
    286292        this->active = true;
    287293
     
    302308        MARSHALLING(clone);
    303309        MARSHALLING(active);
     310        MARSHALLING(freeze);
    304311        MARSHALLING_DYNAMIC(f_set,bool,gsize);
    305312        MARSHALLING_DYNAMIC(s_set,bool,gsize);
  • issm/trunk-jpl/src/c/classes/DofIndexing.h

    r19199 r20462  
    1818
    1919                /*partitioning: */
    20                 bool clone;   //this node is replicated from another one
    21                 bool active;  //Is this node active or inactive (all dofs are constrained)
     20                bool clone;  //this node is replicated from another one
     21                bool active; //Is this node active or inactive (all dofs are constrained)
     22                bool freeze; //this is required for 2d solutions, we never activate nodes that are not on base
    2223
    2324                /*boundary conditions sets: */
  • issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp

    r19254 r20462  
    253253void  Riftfront::InputUpdateFromVector(IssmDouble* vector, int name, int type){/*{{{*/
    254254
    255         _error_("not implemented yet");
     255        /*Nothing to update*/
    256256
    257257}
  • issm/trunk-jpl/src/c/classes/Node.cpp

    r20134 r20462  
    6464                        _assert_(iomodel->Data(FlowequationVertexEquationEnum));
    6565                        if(in_approximation==SSAApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbaseEnum)[io_index])){
    66                                 this->Deactivate();
     66                                this->HardDeactivate();
    6767                        }
    6868                        if(in_approximation==L1L2ApproximationEnum && !reCast<int>(iomodel->Data(MeshVertexonbaseEnum)[io_index])){
    69                                 this->Deactivate();
     69                                this->HardDeactivate();
    7070                        }
    7171                        if(in_approximation==SSAHOApproximationEnum && reCast<int>(iomodel->Data(FlowequationBorderSSAEnum)[io_index])){
    7272                                if(!reCast<int>(iomodel->Data(MeshVertexonbaseEnum)[io_index])){
    73                                         this->Deactivate();
     73                                        this->HardDeactivate();
    7474                                }
    7575                        }
     
    8282                /*spc all nodes on SIA*/
    8383                if(in_approximation==SIAApproximationEnum){
    84                         this->Deactivate();
     84                        this->HardDeactivate();
    8585                }
    8686        }
     
    101101                        _assert_(iomodel->Data(MeshVertexonbaseEnum));
    102102                        if(!(reCast<bool>(iomodel->Data(MeshVertexonbaseEnum)[io_index]))){
    103                                 this->Deactivate();
     103                                this->HardDeactivate();
    104104                        }
    105105                }
     
    112112                        _assert_(iomodel->Data(MeshVertexonsurfaceEnum));
    113113                        if(!(reCast<bool>(iomodel->Data(MeshVertexonsurfaceEnum)[io_index]))){
    114                                 this->Deactivate();
     114                                this->HardDeactivate();
    115115                        }
    116116                }
     
    463463
    464464        if(this->indexing.f_set[dof] == 1){
     465                //if(this->indexing.freeze) _error_("Cannot change dof of frozen node");
    465466                this->indexingupdate = true;
    466467                this->indexing.f_set[dof]=0; //n splits into f (for which we solve) and s (single point constraints)
     
    476477
    477478        if(this->indexing.f_set[dof] == 0){
     479                if(this->indexing.freeze) _error_("Cannot change dof of frozen node");
    478480                this->indexingupdate = true;
    479481                this->indexing.f_set[dof]=1;
     
    485487
    486488        DofInSSet(dof); //with 0 displacement for this dof.
     489        //FIXME: for now we don't want this element to change so we use freeze
     490        this->indexing.freeze =true;
    487491
    488492}
     
    490494void Node::Deactivate(void){/*{{{*/
    491495
    492         if(IsActive()){
     496        if(IsActive() && !this->indexing.freeze){
    493497                this->indexingupdate = true;
    494498                indexing.Deactivate();
     
    497501}
    498502/*}}}*/
     503void Node::HardDeactivate(void){/*{{{*/
     504
     505        this->indexing.Deactivate();
     506        this->indexing.freeze =true;
     507
     508}
     509/*}}}*/
    499510void Node::Activate(void){/*{{{*/
    500511
    501         if(!IsActive()){
     512        if(!IsActive() && !this->indexing.freeze){
    502513                this->indexingupdate = true;
    503514                indexing.Activate();
  • issm/trunk-jpl/src/c/classes/Node.h

    r19199 r20462  
    7373                void  Activate(void);
    7474                void  Deactivate(void);
     75                void  HardDeactivate(void);
    7576                void  ReindexingDone(void);
    7677                bool  RequiresDofReindexing(void);
  • issm/trunk-jpl/src/c/modules/SetActiveNodesLSMx/SetActiveNodesLSMx.cpp

    r20457 r20462  
    4949                }
    5050
    51                 /* if solving 2d problem on vertically extende mesh, solve on basal layer only*/
    52                 if(domaintype!=Domain2DhorizontalEnum){
    53                         femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    54                         if(
    55                                         analysis_type==FreeSurfaceBaseAnalysisEnum ||
    56                                         analysis_type==MasstransportAnalysisEnum ||
    57                                         analysis_type==MeltingAnalysisEnum ||
    58                                         analysis_type==L2ProjectionBaseAnalysisEnum ||
    59                                         analysis_type==BalancethicknessAnalysisEnum ||
    60                                         analysis_type==HydrologyDCInefficientAnalysisEnum ||
    61                                         //analysis_type==DamageEvolutionAnalysisEnum ||
    62                                         analysis_type==HydrologyDCEfficientAnalysisEnum ||
    63                                         analysis_type==LevelsetAnalysisEnum ||
    64                                         analysis_type==ExtrapolationAnalysisEnum
    65                                         ){ solvein2d=true;}
    66 
    67                         if(analysis_type==StressbalanceAnalysisEnum){
    68                                 bool isSIA,isSSA,isL1L2;
    69                                 femmodel->parameters->FindParam(&isSIA,FlowequationIsSIAEnum);
    70                                 femmodel->parameters->FindParam(&isSSA,FlowequationIsSSAEnum);
    71                                 femmodel->parameters->FindParam(&isL1L2,FlowequationIsL1L2Enum);
    72                                 if(isSIA || isSSA || isL1L2)
    73                                         solvein2d=true;
    74                         }
    75 
    76                         if(solvein2d){
    77                                 IssmDouble *mask_isonbase = xNew<IssmDouble>(numnodes);
    78                                 element->GetInputListOnNodes(&mask_isonbase[0],MeshVertexonbaseEnum);
    79                                 for(in=0;in<numnodes;in++)       mask[in]*=mask_isonbase[in];
    80                                 xDelete<IssmDouble>(mask_isonbase);
    81                         }
    82                 }
    83 
    8451                for(in=0;in<numnodes;in++){
    8552                        Node* node=element->GetNode(in);
Note: See TracChangeset for help on using the changeset viewer.