Files
opm-core/matalloc.c
Jostein R. Natvig e04eb2f728 Initial checkin of cornerpoint processing code.
Current status
--------------
Given vectors ZCORN, COORD and ACTNUM as well as the Cartesian
dimensions these vectors implicitly refer to, the code is
currently capable of

 * Identify unique points along each pillar
 * Assign point numbers for each point specified in ZCORN
 * Compute face topology, i.e., the corners that define the geometry
   of the faces as well as the cells that are connected through the face.
 * Identify and compute intesections that occur in the processing of
   face topology.

What remains is

 * Handle the face geometry of boundary faces. (simple)
 * Compute point coordinates of the final point list.
 * Put all pieces together in a tidy manner.
2009-06-11 07:33:50 +00:00

25 lines
466 B
C

#include <stdlib.h>
#include "matalloc.h"
double **dmatalloc(int m, int n)
{
double **ret = malloc(m*sizeof *ret);
ret[0] = malloc(m*n*sizeof *ret[0]);
int i;
for (i=1; i<m; ++i) {
ret[i] = ret[i-1]+n*sizeof *ret[0];
}
return ret;
}
int **imatalloc(int m, int n)
{
int **ret = malloc(m*sizeof *ret);
ret[0] = malloc(m*n*sizeof *ret[0]);
int i;
for (i=1; i<m; ++i) {
ret[i] = ret[i-1]+n*sizeof *ret[0];
}
return ret;
}