Changeset 3450


Ignore:
Timestamp:
04/08/10 07:57:36 (15 years ago)
Author:
seroussi
Message:

added CreateConstraints for Thermal

Location:
issm/trunk/src/c/ModelProcessorx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/Melting/CreateLoadsMelting.cpp

    r3449 r3450  
    3434        IoModelFetchData(&iomodel->gridonbed,NULL,NULL,iomodel_handle,"gridonbed");
    3535
     36        count=1; //matlab indexing
    3637        for (i=0;i<iomodel->numberofvertices;i++){
    3738                /*keep only this partition's nodes:*/
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateConstraintsThermal.cpp

    r3446 r3450  
    1010#include "../IoModel.h"
    1111
    12 
    1312void    CreateConstraintsThermal(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
    1413
    15 
    1614        int i;
    17         int count;
     15        int count=0;
    1816       
    1917        DataSet* constraints = NULL;
    2018        Spc*    spc  = NULL;
    2119
    22         /*spc intermediary data: */
    23         int spc_sid;
    24         int spc_node;
    25         int spc_dof;
    26         double spc_value;
    27        
    2820        double* spctemperature=NULL;
    2921       
     
    3729        IoModelFetchData(&spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
    3830
    39         count=0;
     31        count=1;
    4032
    4133        /*Create spcs from x,y,z, as well as the spc values on those spcs: */
    4234        for (i=0;i<iomodel->numberofvertices;i++){
    43         #ifdef _PARALLEL_
    44         /*keep only this partition's nodes:*/
    45         if((iomodel->my_vertices[i]==1)){
    46         #endif
     35                /*keep only this partition's nodes:*/
     36                if((iomodel->my_vertices[i]==1)){
    4737
    48                 if ((int)spctemperature[2*i]){
    49        
    50                         /*This grid needs to be spc'd to vx_obs and vy_obs:*/
     38                        if ((int)spctemperature[2*i]){
    5139
    52                         spc_sid=count;
    53                         spc_node=i+1;
    54                         spc_dof=1; //we enforce first translation degree of freedom, for temperature
    55                         spc_value=spctemperature[2*i+1];
     40                                constraints->AddObject(new Spc(count,i+1,1,spctemperature[2*i+1]));
     41                                count++;
    5642
    57                         spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
    58                         constraints->AddObject(spc);
    59                         count++;
     43                        }
    6044
    61                 }
    62 
    63         #ifdef _PARALLEL_
    64         } //if((my_grids[i]==1))
    65         #endif
     45                } //if((my_grids[i]==1))
    6646        }
    6747
     
    7050        constraints->Presort();
    7151
    72        
    7352        cleanup_and_return:
    7453        /*Free data: */
  • issm/trunk/src/c/ModelProcessorx/Thermal/CreateLoadsThermal.cpp

    r3449 r3450  
    3232        IoModelFetchData(&iomodel->spctemperature,NULL,NULL,iomodel_handle,"spctemperature");
    3333
     34        count=1; //matlab indexing
    3435        for (i=0;i<iomodel->numberofvertices;i++){
    3536                /*keep only this partition's nodes:*/
Note: See TracChangeset for help on using the changeset viewer.