Program Design Question
Barry Smith
bsmith at mcs.anl.gov
Mon May 8 14:36:04 CDT 2006
On Mon, 8 May 2006, Joshua L. Adelman wrote:
> I am a new user of PETsc and was hoping that a more experienced member of the
> group could give me some insight as to what would be the proper formulation
> of the following problem in PETsc. I am attempting to solve the simple ODE:
> d{rho}/dt = K*rho
>
Is d{rho}/dt implemented simply as {{rho}^{n+1} - {rho}^{n})/dt or do you
have a mass matrix involved?
> Where K is a large rate matrix that doesn't depend on time within the
> simulation (i.e K(x)) and rho is a vector of densities. K is usually stiff as
> it contains terms that reflect both diffusive and chemical transitions, and
> its entries are sparse. I am interested in the evolution of the system in
> time as well as the steady-state behavior. I have already implemented a
> version of the code in Matlab and am looking to write a PETsc version that
> can be run in parallel on a cluster. In my matlab code, setting up K is fast
> and the rate limiting step is actually doing the solve.
>
> Is the appropriate approach using the Backward Euler TS to solve the problem?
If there is not mass matrix then yes, you want to use that.
> Also it is unclear to me whether I need to employ Distributed Arrays (DA).
If your ODE comes from discretizing a PDE on a structured (rectangular) grid
in 2 or 3d then the DA may be helpful to organize the partitioning of the
domain. But so long as you have a way of computing K in parallel (or computing
it fast sequentially (say in Matlab) and then loading it in in parallel then
you have no reason to us DA.
Barry
>I
> can provide more information about the nature of the simulation if necessary
> if it helps in answering my questions.
>
> Any suggestions/insight would be most appreciated.
>
> Josh
>
More information about the petsc-users
mailing list