source: issm/oecreview/Archive/12678-13393/ISSM-12861-12862.diff

Last change on this file was 13394, checked in by Mathieu Morlighem, 13 years ago

Added 12678-13393

File size: 3.0 KB
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.cpp

     
    1 /* \file alloc_module.h
    2  */
    3 
    4 
    5 #ifdef HAVE_CONFIG_H
    6         #include <config.h>
    7 #else
    8 #error "Cannot compile without HAVE_CONFIG_H symbol! run configure first!"
    9 #endif
    10 
    11 #include <stdio.h>
    12 #include <stdlib.h>
    13 
    14 #include  "./alloc_module.h"
    15 #include "../Exceptions/exceptions.h"
    16 #include "../../include/include.h"
    17 #include "../../classes/objects/objects.h"
    18 
    19 void xdelete_module(Matrix** pv){
    20        
    21         if (pv && *pv){
    22                 /*Actually, still get rid of internal Petsc matrix. Quick fix until Matlab handles C++
    23                  * correctly: */
    24                 #ifdef _HAVE_PETSC_
    25                         MatFree(&(*pv)->pmatrix->matrix);
    26                 #endif
    27                 *pv=NULL;
    28         }
    29 }
    30 
    31 void xdelete_module(Vector** pv){
    32 
    33         if (pv && *pv){
    34                 /*Actually, still get rid of internal Petsc vector. Quick fix until Matlab handles C++
    35                  * correctly: */
    36                 #ifdef _HAVE_PETSC_
    37                         VecFree(&(*pv)->pvector->vector);
    38                 #endif
    39                 *pv=NULL;
    40         }
    41 }
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/Alloc/alloc_module.h

     
    1 /* \file alloc.h
    2  */
    3 
    4 #ifndef _ALLOC_MODULE_H_
    5 #define _ALLOC_MODULE_H_
    6 class Matrix;
    7 class Vector;
    8 void xdelete_module(Matrix** pvptr);
    9 void xdelete_module(Vector** pvptr);
    10 
    11 #endif
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/shared/shared.h

     
    66#define _SHARED_H_
    77
    88#include "Alloc/alloc.h"
    9 #include "Alloc/alloc_module.h"
    109#include "Alloc/xNewDelete.h"
    1110#include "Bamg/shared.h"
    1211#include "Elements/elements.h"
  • u/astrid-r1b/morlighe/issmuci/trunk-jpl/../trunk-jpl/src/c/Makefile.am

     
    838838
    839839#}}}
    840840#Modules sources{{{
    841 module_sources= ./shared/Alloc/alloc_module.h\
    842                         ./shared/Alloc/alloc_module.cpp\
    843                         ./shared/Threads/issm_threads.h\
     841module_sources= ./shared/Threads/issm_threads.h\
    844842                        ./shared/Threads/LaunchThread.cpp\
    845843                        ./shared/Threads/PartitionRange.cpp\
    846844                        ./shared/Exp/exp.h\
Note: See TracBrowser for help on using the repository browser.