Ingo Gaertner <[email protected]> writes: > We have never talked about Riemann solvers in our CFD course, and I don't > understand what's going on in ex11. > However, if you could answer a few of my questions, you'll give me a good > start with PETSc. For the simple poisson problem that I am trying to > implement, I have to discretize div(k grad u) integrated over each FV cell, > where k is the known diffusivity, and u is the vector to solve for.
Note that ex11 solves hyperbolic conservation laws, but you are solving an elliptic equation. > The cell integral is approximated as the sum of the fluxes (k grad u) > in each face centroid multiplied by each surface area vector. In > principle, I have all necessary information available in the DMPlex to > assemble the FV matrix for div(k grad u), assuming an orthogonal grid > for the beginning. But I thought that the gradient coefficients > should be available in the PETScFVFaceGeom.grad elements of the > faceGeometry vector after using the methods > > DMPlexComputeGeometryFVM > <https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DMPLEX/DMPlexComputeGeometryFVM.html#DMPlexComputeGeometryFVM>(DM > <https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/DM/DM.html#DM> > dm, Vec > <https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Vec/Vec.html#Vec> > *cellgeom, Vec > <https://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/Vec/Vec.html#Vec> > *facegeom) and > DMPlexComputeGradientFVM > <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DMPLEX/DMPlexComputeGradientFVM.html#DMPlexComputeGradientFVM>(DM > <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DM/DM.html#DM> > dm, PetscFV > <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DM/PetscFV.html#PetscFV> > fvm, Vec > <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/Vec.html#Vec> > faceGeometry, Vec > <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/Vec/Vec.html#Vec> > cellGeometry, DM > <https://www.mcs.anl.gov/petsc/petsc-master/docs/manualpages/DM/DM.html#DM> > *dmGrad) > > But, while these calls fill in the cell and face centroids, volumes and > normals, the PETScFVFaceGeom.grad elements of the faceGeometry vector are > all zero. Am I misunderstanding the purpose of DMPlexComputeGradientFVM? This routine is intended to do a conservative reconstruction of a piecewise linear function from piecewise constant data. Is that what you want? > (My second question is more general about the PETSc installation. When I > configure PETSc with "--prefix=/somewhere --download-triangle > --download-parmetis" etc., these extra libraries are built correctly during > the make step, but they are not copied to /somewhere during the "make > install" step. Where are they put during configure? > Also the pkg-config files don't include the details about the extra > libraries. Is it intended that one has to manually correct the install > directory, or am I missing something during the configuration or > installation steps?) You shouldn't need that if linking with shared libraries (pkg-config says not to list them), but you can use pkg-config --static to get the transitive dependencies.
signature.asc
Description: PGP signature
