An improved method and system are disclosed for creating on a computer a
native operators and test code file for a finite element simulator to
model fluid flow in porous media. The method of the present invention
includes the steps of inputting into a symbolic language translator
equations and parameters describing the model to be created by the
simulator and generating one or more model objects from the equations and
parameters. The method of the present invention further includes the steps
of generating a symbolic representation of the residual and tangent matrix
operators of the model objects and generating optimization rules for any
geometric invariant quantities. Numeric core code and data structure
initializing core code are generated for the simulator in a high level
programming language from the language of the symbolic language
translator. The numeric core code is formatted and optimized. The present
invention generates the native operators and test code file by processing
the splice file through the symbolic language translator.