Changeset 3453


Ignore:
Timestamp:
04/08/10 08:08:32 (15 years ago)
Author:
seroussi
Message:

added CreateConstraints for Stokes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/DiagnosticStokes/CreateConstraintsDiagnosticStokes.cpp

    r3446 r3453  
    1010#include "../IoModel.h"
    1111
    12 
    1312void    CreateConstraintsDiagnosticStokes(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1413
     
    1817
    1918        /*spc intermediary data: */
    20         int spc_sid;
    21         int spc_node;
    22         int spc_dof;
    23         double spc_value;
    24         int count;
    25        
    2619        double* gridonstokes=NULL;
    27 
    2820
    2921        /*Create constraints: */
     
    3628        IoModelFetchData(&gridonstokes,NULL,NULL,iomodel_handle,"gridonstokes");
    3729
    38         count=0;
     30        count=1; //matlab indexing
    3931        /*Create spcs from x,y,z, as well as the spc values on those spcs: */
    4032        for (i=0;i<iomodel->numberofvertices;i++){
    41         #ifdef _PARALLEL_
    42         /*keep only this partition's nodes:*/
    43         if((iomodel->my_vertices[i]==1)){
    44         #endif
     33                /*keep only this partition's nodes:*/
     34                if((iomodel->my_vertices[i]==1)){
    4535
    46                 if ((int)!gridonstokes[i]){
    47        
    48                         /*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */
    49                         spc_sid=count;
    50                         spc_node=i+1;
    51                         spc_dof=1; //we enforce first x translation degree of freedom
    52                         spc_value=0;
     36                        if ((int)!gridonstokes[i]){
    5337
    54                         spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
    55                         constraints->AddObject(spc);
    56                         count++;
     38                                /*This grid will see its vx,vy and vz dofs spc'd to pattyn velocities: */
     39                                constraints->AddObject(new Spc(count,i+1,1,0));
     40                                count++;
    5741
    58                         spc_sid=count;
    59                         spc_node=i+1;
    60                         spc_dof=2; //we enforce first y translation degree of freedom
    61                         spc_value=0;
    62                        
    63                         spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
    64                         constraints->AddObject(spc);
    65                         count++;
    66                        
    67                         spc_sid=count;
    68                         spc_node=i+1;
    69                         spc_dof=3; //we enforce first y translation degree of freedom
    70                         spc_value=0;
    71                        
    72                         spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
    73                         constraints->AddObject(spc);
    74                         count++;
     42                                constraints->AddObject(new Spc(count,i+1,2,0));
     43                                count++;
    7544
    76                 }
    77 
    78         #ifdef _PARALLEL_
    79         } //if((my_vertices[i]==1))
    80         #endif
     45                                constraints->AddObject(new Spc(count,i+1,3,0));
     46                                count++;
     47                        }
     48                } //if((my_vertices[i]==1))
    8149        }
    8250
Note: See TracChangeset for help on using the changeset viewer.