Ignore:
Timestamp:
03/31/10 16:43:20 (15 years ago)
Author:
Mathieu Morlighem
Message:

Added discontinuous galerkin elements and prognostic2 solution, to be continued...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/ModelProcessorx/Prognostic2/CreateConstraintsPrognostic2.cpp

    r3354 r3359  
    22 * CreateConstraintsPrognostic2.c:
    33 */
    4 
    54
    65#include "../../DataSet/DataSet.h"
     
    1110#include "../IoModel.h"
    1211
    13 
    1412void    CreateConstraintsPrognostic2(DataSet** pconstraints, IoModel* iomodel,ConstDataHandle iomodel_handle){
    15 
    16 
    17         int i;
    18         int count;
    1913       
    2014        DataSet* constraints = NULL;
    21         Spc*    spc  = NULL;
    22 
    23         /*spc intermediary data: */
    24         int spc_sid;
    25         int spc_node;
    26         int spc_dof;
    27         double spc_value;
    28        
    29         double* spcthickness=NULL;
    3015       
    3116        /*Create constraints: */
    3217        constraints = new DataSet(ConstraintsEnum());
    33 
    34         /*Fetch data: */
    35         IoModelFetchData(&spcthickness,NULL,NULL,iomodel_handle,"spcthickness");
    36 
    37         count=0;
    38 
    39         /*Create spcs from x,y,z, as well as the spc values on those spcs: */
    40         for (i=0;i<iomodel->numberofnodes;i++){
    41         #ifdef _PARALLEL_
    42         /*keep only this partition's nodes:*/
    43         if((iomodel->my_grids[i]==1)){
    44         #endif
    45 
    46                 if ((int)spcthickness[2*i]){
    47        
    48                         /*This grid needs to be spc'd: */
    49 
    50                         spc_sid=count;
    51                         spc_node=i+1;
    52                         spc_dof=1; //we enforce first translation degree of freedom, for temperature
    53                         spc_value=*(spcthickness+2*i+1);
    54 
    55                         spc = new Spc(spc_sid,spc_node,spc_dof,spc_value);
    56                         constraints->AddObject(spc);
    57                         count++;
    58                 }
    59 
    60         #ifdef _PARALLEL_
    61         } //if((my_grids[i]==1))
    62         #endif
    63         }
    64 
    65         /*All our datasets are already order by ids. Set presort flag so that later on, when sorting is requested on these
    66          * datasets, it will not be redone: */
    67         constraints->Presort();
    68 
    69         /*Free data: */
    70         xfree((void**)&spcthickness);
    71        
    72         cleanup_and_return:
    7318       
    7419        /*Assign output pointer: */
Note: See TracChangeset for help on using the changeset viewer.