In this assignment the objective is to solve the nonlinear equation using NOX, i.e.
with constant Dirchelet boundary conditions. is a constant parameter that controls the strength of the nonlinearity. Use a finite difference discretization with constant grid spacing.
Your assignment is to complete the required computeF()
function in the class OneDimNonlinear
. You must perform an import operation to communicate off-processor "overlaped" nodal values withing computeF()
and fill the argument vector F
with the residual from the finite difference operation.
Your code should be parallel consistent, i.e. it should produce the exact same answer independent of the number of processors you specify.
If you would like to check to see if your solution is correct, run the following commands at the Terminal command line:
mpiexec -np 1 python test.py
mpiexec -np 2 python test.py
mpiexec -np 3 python test.py