/* ---------------------------------------------------------------------- */ struct TransportSource * create_transport_source(int nsrc, int nphase) /* ---------------------------------------------------------------------- */ { int status; struct TransportSource *src; if (nphase <= 0) { src = NULL; } else { src = malloc(1 * sizeof *src); if (src != NULL) { src->nsrc = src->cpty = 0; src->nphase = nphase; src->cell = NULL; src->pressure = NULL; src->flux = NULL; src->saturation = NULL; src->surfvolume = NULL; if (nsrc > 0) { status = expand_source_tables(nsrc, src); } else { status = 1; } if (status <= 0) { destroy_transport_source(src); src = NULL; } } } return src; }
TransportSolverTwophaseImplicit::~TransportSolverTwophaseImplicit() { destroy_transport_source(tsrc_); }