https://github.com/hpc-maths/GenEO
Revision 3881e864d0115355ab0398e22b489d3d1df7997a authored by gouarin on 30 March 2018, 12:29:37 UTC, committed by gouarin on 30 March 2018, 12:29:37 UTC
1 parent eb1bfe3
Tip revision: 3881e864d0115355ab0398e22b489d3d1df7997a authored by gouarin on 30 March 2018, 12:29:37 UTC
fix mpcg
fix mpcg
Tip revision: 3881e86
rhs.py
from .utils import buildVecWithFunction
from.assembling import buildMassMatrix
def buildRHS(da, h, apply_func):
"""
Construct the second member of the elasticity problem.
Parameters
==========
da : petsc.DMDA
The mesh structure.
h : list
The space step in each direction.
apply_func: function
Function corresponding to the f (rhs) in the
elasticity problem.
Returns
=======
b: petsc.Vec
The second member.
"""
b = da.createGlobalVec()
A = buildMassMatrix(da, h)
A.assemble()
tmp = buildVecWithFunction(da, apply_func)
A.mult(tmp, b)
return b
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...