Topic: Move file loading out from save and restore functions => reduce code

By adding the loading outside of the "restoreContext" and "saveContext" files, the logic in these can be greatly simplified
Just a few lines of code, at most something like this:

            FILE *file;
            int iversion, istep;
            problem->resolveCorrespondingStepNumber(&istep, &iversion, ( void * ) restartStepInfo);
            if ( !problem->giveContextFile(& file, istep, iversion, contextMode_write) ) {
                THROW_CIOERR(CIO_IOERR);
            }
            FileDataStream stream(file);
            problem->restoreContext(& stream, CM_State | CM_Definition, ( void * ) restartStepInfo);
            fclose(file);

would greatly increase the flexibility of the code. (similar changes to OOFEG)

Restore context would be reduced to just the essential parts, e.g:

contextIOResultType
StationaryTransportProblem :: restoreContext(DataStream *stream, ContextMode mode)
{
    contextIOResultType iores;

    if ( ( iores = EngngModel :: restoreContext(stream, mode) ) != CIO_OK ) {
        THROW_CIOERR(iores);
    }

    if ( ( iores = UnknownsField->restoreContext(*stream, mode) ) != CIO_OK ) {
        THROW_CIOERR(iores);
    }
    return CIO_OK;
}

Even more, why have both return type, and exceptions, that basically represent the same thing? We could just have;

void
StationaryTransportProblem :: restoreContext(DataStream *stream, ContextMode mode)
{
    EngngModel :: restoreContext(stream, mode);
    UnknownsField->restoreContext(*stream, mode);
}

and let everything throw the exceptions instead, or, alternatively, just stick to return values. This would reduce every implementation of restoreContext  from ~25 LOC, to only ~2 LOC.

Save context would be similar, just move it out to the caller to feed the stream. This would also get rid of the need for the void* obj argument.


It's not a difficult change to do, but, I'm a little afraid to break OOFEG stuff, as I'm not a user of the graphical interface. So, there might be some strange cornercase that I have missed.