How do I resolve issue with calling the PETSc function 'KSPSolve', with a PETSc error code of 76, indicating an error in an external library?

1. Fenics/Dolfin version and Installation
I am running the code in google colab environment using DOLFIN version: 2019.2.0.dev0. I install Fenics via Packages — FEM on Colab.

2. I encountered the error in this section of the code:

# SOLUTION MECHANICAL VENTILATION ##########################
#for i, mult in enumerate(steps):
for i in np.arange(len(times)):
    # messages
    if dolfin.MPI.rank(dolfin.MPI.comm_world) == 0:
        print('Solving step '+str(i)+' ...')
    t = times[i]
    dtt = dts[i]
    presion = ps[i]
    dt.beta = dtt

    p_value.presiones=presion
    print('PRESSURE',presion,'TIME',t)

    # run fenics solver
    w0.assign(w)
    it, conv = solver.solve(NLproblem, w.vector())
    # Extract solution components
    u, p = w.split()
    u.rename("u", "displacement")
    p.rename("p", "pressure")


    if dolfin.MPI.rank(dolfin.MPI.comm_world) == 0:
        file_info.write('Step '+str(i)+ ' has converged in '+str(it)+' iterations \n')
        file_info.flush()


    # get volume, volume and flux
    Vi = dolfin.assemble(J*dx)
    Jacob.append(Vi/1000000)
    deltavol = dolfin.assemble(((J-J0)/dt)*dx)
    fluxes.append(deltavol*10**-6)
    presionestodas.append(presion)

3. Here is the error Message:
RuntimeError Traceback (most recent call last)

in <cell line: 8>()
222 # run fenics solver
223 w0.assign(w)
→ 224 it, conv = solver.solve(NLproblem, w.vector())
225 # Extract solution components
226 u, p = w.split()

/content/modelfunctions.py in solve(self, myproblem, x)
347 # iterations
348 if not self.dx.empty(): self.dx.zero()
→ 349 self.krylov_iterations += self.solver.solve(self.dx, self.b);
350
351 # Update solution

That’s a good improvement over Please i need assistance on how to resolve the PETScKrylovSolver's Error below but, sorry, that’s still not good enough.

We’ll need the whole code (e.g., to see how NLproblem is defined, and to possibly run the code ourselves). Please make it as minimal as possible (i.e., remove all parts which are not truly needed to get the error) otherwise it’ll be unlikely that anyone will spend their own free time to help you.

Good Morning Sir,

Thanks for your quick response to my case. I am actually understudying Lung poromechanics simulation in Fenics based on an existing code in Github site. Please find below the link to the full code:

https://github.com/comp-medicine-uc/multiscale-lung-mechanics

Thanks

I can’t find any code in the repository, and looking at the git history it seems that the author has purposely deleted parts of the code.

It’s quite a heavy task to read an entire library, let alone if to get its bits and pieces one needs to process the git history. Due to that, I, and possibly other people in the community, won’t have the time to help. IMHO, your best option is to get in touch with the author of the repository.

Thanks for your quick response to my case. I am actually understudying Lung poromechanics simulation in Fenics based on an existing code in Github site. Please find below the link to the full code:

   https://github.com/comp-medicine-uc/multiscale-lung-mechanics

Thanks