Moved free_grid() to grid.h and (new file) grid.c.
This commit is contained in:
parent
866cb0b6ab
commit
b66ee75058
@ -50,6 +50,7 @@ opm/core/fluid/RockCompressibility.cpp \
|
||||
opm/core/fluid/RockFromDeck.cpp \
|
||||
opm/core/fluid/SaturationPropsBasic.cpp \
|
||||
opm/core/fluid/SaturationPropsFromDeck.cpp \
|
||||
opm/core/grid.c \
|
||||
opm/core/grid/cart_grid.c \
|
||||
opm/core/grid/cornerpoint_grid.c \
|
||||
opm/core/grid/cpgpreprocess/geometry.c \
|
||||
|
46
opm/core/grid.c
Normal file
46
opm/core/grid.c
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
||||
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <opm/core/grid.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
void free_grid(struct UnstructuredGrid *g)
|
||||
{
|
||||
if (g!=NULL)
|
||||
{
|
||||
free(g->face_nodes);
|
||||
free(g->face_nodepos);
|
||||
free(g->face_cells);
|
||||
free(g->cell_facepos);
|
||||
free(g->cell_faces);
|
||||
|
||||
free(g->node_coordinates);
|
||||
free(g->face_centroids);
|
||||
free(g->face_areas);
|
||||
free(g->face_normals);
|
||||
free(g->cell_centroids);
|
||||
free(g->cell_volumes);
|
||||
|
||||
free(g->global_cell);
|
||||
free(g->cell_facetag);
|
||||
}
|
||||
|
||||
free(g);
|
||||
}
|
||||
|
@ -56,6 +56,10 @@ struct UnstructuredGrid {
|
||||
int *cell_facetag;
|
||||
};
|
||||
|
||||
|
||||
void free_grid(struct UnstructuredGrid *g);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -103,30 +103,6 @@ fill_cell_topology(struct processed_grid *pg,
|
||||
return g->cell_facepos != NULL;
|
||||
}
|
||||
|
||||
void free_grid(struct UnstructuredGrid *g)
|
||||
{
|
||||
if (g!=NULL)
|
||||
{
|
||||
free(g->face_nodes);
|
||||
free(g->face_nodepos);
|
||||
free(g->face_cells);
|
||||
free(g->cell_facepos);
|
||||
free(g->cell_faces);
|
||||
|
||||
free(g->node_coordinates);
|
||||
free(g->face_centroids);
|
||||
free(g->face_areas);
|
||||
free(g->face_normals);
|
||||
free(g->cell_centroids);
|
||||
free(g->cell_volumes);
|
||||
|
||||
free(g->global_cell);
|
||||
free(g->cell_facetag);
|
||||
}
|
||||
|
||||
free(g);
|
||||
}
|
||||
|
||||
static int
|
||||
allocate_geometry(struct UnstructuredGrid *g)
|
||||
{
|
||||
|
@ -46,7 +46,6 @@ extern "C" {
|
||||
|
||||
void compute_geometry (struct UnstructuredGrid *g);
|
||||
|
||||
void free_grid(struct UnstructuredGrid *g);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user