Changeset 12345


Ignore:
Timestamp:
06/01/12 20:48:42 (13 years ago)
Author:
utke
Message:

rename and try out the xNew/xDelete here to see if it works in the
regression test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/objects/Node.cpp

    r12014 r12345  
    439439#ifdef _HAVE_DIAGNOSTIC_
    440440/*FUNCTION Node::GetCoordinateSystem{{{1*/
    441 void Node::GetCoordinateSystem(double* coord_system_out){
     441void Node::GetCoordinateSystem(IssmDouble* coord_system_out){
    442442
    443443        /*Copy coord_system*/
     
    466466/*Node numerics:*/
    467467/*FUNCTION Node::ApplyConstraints{{{1*/
    468 void  Node::ApplyConstraint(int dof,double value){
     468void  Node::ApplyConstraint(int dof,IssmDouble value){
    469469
    470470        int index;
     
    487487void  Node::CreateVecSets(Vector* pv_g,Vector* pv_f,Vector* pv_s){
    488488
    489         double gvalue=1.0; //all nodes are in the g set;
    490         double value;
     489        IssmDouble gvalue=1.0; //all nodes are in the g set;
     490        IssmDouble value;
    491491
    492492        int i;
     
    498498               
    499499                /*f set: */
    500                 value=(double)this->indexing.f_set[i];
     500                value=(IssmDouble)this->indexing.f_set[i];
    501501                pv_f->SetValue(indexing.gdoflist[i],value,INS_VAL);
    502502
    503503                /*s set: */
    504                 value=(double)this->indexing.s_set[i];
     504                value=(IssmDouble)this->indexing.s_set[i];
    505505                pv_s->SetValue(indexing.gdoflist[i],value,INS_VAL);
    506506
     
    514514
    515515        int i;
    516         double* values=NULL;
     516        IssmDouble* values=NULL;
    517517        int count;
    518518
    519519        /*Recover values for s set and plug them in constraints vector: */
    520520        if(this->indexing.ssize){
    521                 values=(double*)xmalloc(this->indexing.ssize*sizeof(double));
     521                values=xNew<IssmDouble>(this->indexing.ssize);
    522522                count=0;
    523523                for(i=0;i<this->indexing.gsize;i++){
     
    534534
    535535        /*Free ressources:*/
    536         xfree((void**)&values);
     536        xDelete<IssmDouble>(values);
    537537
    538538
     
    634634/*}}}*/
    635635/*FUNCTION Node::GetSigma {{{1*/
    636 double Node::GetSigma(){
     636IssmDouble Node::GetSigma(){
    637637        Vertex* vertex=NULL;
    638638
     
    642642/*}}}*/
    643643/*FUNCTION Node::GetX {{{1*/
    644 double Node::GetX(){
     644IssmDouble Node::GetX(){
    645645        Vertex* vertex=NULL;
    646646
     
    650650/*}}}*/
    651651/*FUNCTION Node::GetY {{{1*/
    652 double Node::GetY(){
     652IssmDouble Node::GetY(){
    653653        Vertex* vertex=NULL;
    654654
     
    658658/*}}}*/
    659659/*FUNCTION Node::GetZ {{{1*/
    660 double Node::GetZ(){
     660IssmDouble Node::GetZ(){
    661661        Vertex* vertex=NULL;
    662662
     
    716716}
    717717/*}}}*/
    718 /*FUNCTION Node::InputUpdateFromVector(double* vector, int name, int type){{{1*/
    719 void  Node::InputUpdateFromVector(double* vector, int name, int type){
     718/*FUNCTION Node::InputUpdateFromVector(IssmDouble* vector, int name, int type){{{1*/
     719void  Node::InputUpdateFromVector(IssmDouble* vector, int name, int type){
    720720
    721721        /*Nothing updated yet*/
     
    734734}
    735735/*}}}*/
    736 /*FUNCTION Node::InputUpdateFromVectorDakota(double* vector, int name, int type){{{1*/
    737 void  Node::InputUpdateFromVectorDakota(double* vector, int name, int type){
     736/*FUNCTION Node::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){{{1*/
     737void  Node::InputUpdateFromVectorDakota(IssmDouble* vector, int name, int type){
    738738
    739739        /*Nothing updated yet*/
    740740}
    741741/*}}}*/
    742 /*FUNCTION Node::InputUpdateFromMatrixDakota(double* matrix, int nrows, int ncols, int name, int type){{{1*/
    743 void  Node::InputUpdateFromMatrixDakota(double* matrix, int nrows, int ncols, int name, int type){
     742/*FUNCTION Node::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){{{1*/
     743void  Node::InputUpdateFromMatrixDakota(IssmDouble* matrix, int nrows, int ncols, int name, int type){
    744744
    745745        /*Nothing updated yet*/
     
    758758}
    759759/*}}}*/
    760 /*FUNCTION Node::InputUpdateFromConstant(double constant, int name){{{1*/
    761 void  Node::InputUpdateFromConstant(double constant, int name){
     760/*FUNCTION Node::InputUpdateFromConstant(IssmDouble constant, int name){{{1*/
     761void  Node::InputUpdateFromConstant(IssmDouble constant, int name){
    762762
    763763        /*Nothing updated yet*/
     
    777777/*}}}*/
    778778/*FUNCTION Node::UpdateSpcs {{{1*/
    779 void   Node::UpdateSpcs(double* ys){
     779void   Node::UpdateSpcs(IssmDouble* ys){
    780780
    781781        int     count=0;
     
    792792/*}}}*/
    793793/*FUNCTION Node::VecMerge {{{1*/
    794 void   Node::VecMerge(Vector* ug, double* vector_serial,int setenum){
    795 
    796         double* values=NULL;
     794void   Node::VecMerge(Vector* ug, IssmDouble* vector_serial,int setenum){
     795
     796        IssmDouble* values=NULL;
    797797        int*    indices=NULL;
    798798        int     count=0;
     
    802802                if(this->indexing.fsize){
    803803                        indices=(int*)xmalloc(this->indexing.fsize*sizeof(int));
    804                         values=(double*)xmalloc(this->indexing.fsize*sizeof(double));
     804                        values=(IssmDouble*)xmalloc(this->indexing.fsize*sizeof(IssmDouble));
    805805
    806806                        for(i=0;i<this->indexing.gsize;i++){
     
    820820                if(this->indexing.ssize){
    821821                        indices=(int*)xmalloc(this->indexing.ssize*sizeof(int));
    822                         values=(double*)xmalloc(this->indexing.ssize*sizeof(double));
     822                        values=(IssmDouble*)xmalloc(this->indexing.ssize*sizeof(IssmDouble));
    823823
    824824                        for(i=0;i<this->indexing.gsize;i++){
     
    843843/*}}}*/
    844844/*FUNCTION Node::VecReduce {{{1*/
    845 void   Node::VecReduce(Vector* vector, double* ug_serial,int setenum){
    846 
    847         double* values=NULL;
     845void   Node::VecReduce(Vector* vector, IssmDouble* ug_serial,int setenum){
     846
     847        IssmDouble* values=NULL;
    848848        int     count=0;
    849849        int     i;
     
    851851        if(setenum==FsetEnum){
    852852                if(this->indexing.fsize){
    853                         values=(double*)xmalloc(this->indexing.fsize*sizeof(double));
     853                        values=(IssmDouble*)xmalloc(this->indexing.fsize*sizeof(IssmDouble));
    854854
    855855                        for(i=0;i<this->indexing.gsize;i++){
     
    867867        else if(setenum==SsetEnum){
    868868                if(this->indexing.ssize){
    869                         values=(double*)xmalloc(this->indexing.ssize*sizeof(double));
     869                        values=(IssmDouble*)xmalloc(this->indexing.ssize*sizeof(IssmDouble));
    870870
    871871                        for(i=0;i<this->indexing.gsize;i++){
Note: See TracChangeset for help on using the changeset viewer.