[CIG-SHORT] Linear system solve

Brad Aagaard baagaard at usgs.gov
Wed May 9 13:52:00 PDT 2012


On 05/09/2012 01:23 PM, Birendra jha wrote:
> Dear developers,
>
> I have a question about KSPSolve in,
>
> err = KSPSolve(_ksp, residualVec, solutionVec);
> CHECK_PETSC_ERROR(err);
>
> called inside,
>
> pylith::problems::SolverLinear::solve(
> topology::Field<topology::Mesh>* solution, topology::Jacobian*
> jacobian, const topology::Field<topology::Mesh>&  residual)
>
> I find that for same residualVec and jacobian matrix, my solutionVec
> (i.e. dispIncr) changes. What could be the reason? Does KSPSolve do
> anything other than solving Ax=b system, after it's provided with A
> and b?
 > I checked the jacobian in Implicit.py:step() using
 > self.jacobian.view(), before the call to solve() is made. I checked
 > residualVec and solutionVec using
 > VecView(solutionVec,PETSC_VIEWER_STDOUT_WORLD) inside the
 > SolverLinear::solve().
 >

What do you mean solutionVec changes? Do you mean the address of 
solutionVec changes or values inside the solutionVec change? When do 
they change?

KSPSolve is a PETSc routine. The documentation is here 
http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/KSP/KSPSolve.html

Within SolverLinear::Solve() we do have to transfer values between Sieve 
sections and PETSc vectors via scatterSectionToVector() and 
scatterVectorToSection(). These calls will change values of the 
corresponding Sieve sections or PETSc vectors.

> Boundary conditions are independent of time. Compression on two side
> boundaries, and nothing specified for other two sides which means
> traction-free surface, is that correct?

If not BC is specified on a surface, it will be traction free as in 
nearly all finite-element implementations.

Brad



More information about the CIG-SHORT mailing list