Changeset 3443


Ignore:
Timestamp:
04/07/10 17:05:10 (15 years ago)
Author:
Mathieu Morlighem
Message:

Vert

Location:
issm/trunk/src/c/ModelProcessorx/DiagnosticVert
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp

    r3439 r3443  
    22 * CreateConstraintsDiagnosticHoriz.c:
    33 */
    4 
    54
    65#include "../../DataSet/DataSet.h"
     
    1110#include "../IoModel.h"
    1211
    13 
    1412void    CreateConstraintsDiagnosticVert(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1513
    1614        int i;
    17         int count;
    18 
    1915        DataSet* constraints = NULL;
    20         Spc*    spc  = NULL;
    21 
    22         /*spc intermediary data: */
    23         int spc_sid;
    24         int spc_node;
    25         int spc_dof;
    26         double spc_value;
    27 
    28         double* spcvelocity=NULL;
    2916
    3017        /*Create constraints: */
     
    3522
    3623        /*Fetch data: */
    37         IoModelFetchData(&spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity");
    38 
    39         count=0;
     24        IoModelFetchData(&iomodel->spcvelocity,NULL,NULL,iomodel_handle,"spcvelocity");
    4025
    4126        /*Create spcs from x,y,z, as well as the spc values on those spcs: */
    4227        for (i=0;i<iomodel->numberofvertices;i++){
    43       #ifdef _PARALLEL_
     28
    4429                /*keep only this partition's nodes:*/
    45                 if((iomodel->my_grids[i]==1)){
    46       #endif
     30                if(iomodel->my_vertices[i]){
    4731
    4832                        if ((int)spcvelocity[6*i+2]){
    49 
    50                                 /*This grid needs to be spc'd to vx_obs and vy_obs:*/
    51 
    52                                 spc_sid=count;
    53                                 spc_node=i+1;
    54                                 spc_dof=1; //we enforce first translation degree of freedom, for velocity
    55                                 spc_value=spcvelocity[6*i+5];
    56 
    57                                 spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
    58                                 constraints->AddObject(spc);
    59                                 count++;
     33                                constraints->AddObject(new Spc(count,i+1,1,*(iomodel->spcvelocity+6*i+5)/iomodel->yts)); //add count'th spc, on node i+1, setting dof 1 to vx.
    6034
    6135                        }
    62 
    63       #ifdef _PARALLEL_
    6436                } //if((my_grids[i]==1))
    65       #endif
    6637        }
    6738
     
    7041        constraints->Presort();
    7142
    72         cleanup_and_return:
    73 
    7443        /*Free data: */
    75         xfree((void**)&spcvelocity);
     44        xfree((void**)&iomodel->spcvelocity);
    7645       
    7746        /*Assign output pointer: */
  • issm/trunk/src/c/ModelProcessorx/DiagnosticVert/CreateLoadsDiagnosticVert.cpp

    r3332 r3443  
    11/*! \file CreateLoadsDiagnosticVert.c:
    22 */
    3 
    43
    54#include "../../DataSet/DataSet.h"
     
    1110#include "../IoModel.h"
    1211
    13 
    1412void    CreateLoadsDiagnosticVert(DataSet** ploads, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1513
     
    1917        loads   = new DataSet(LoadsEnum());
    2018
    21         /*Now, is the iomodel running in 3d? : */
    22         if (strcmp(iomodel->meshtype,"2d")==0)goto cleanup_and_return;
    23 
    24         cleanup_and_return:
    25        
    2619        /*Assign output pointer: */
    2720        *ploads=loads;
    2821
    2922}
    30 
    31 
Note: See TracChangeset for help on using the changeset viewer.