CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Making Diracbs delta function (https://www.cfd-online.com/Forums/openfoam-solving/58265-making-diracbs-delta-function.html)

henrik November 30, 2008 06:52

createMpSource.H:17: error: no
 
createMpSource.H:17: error: no matching function for call to 'Foam::fvMesh::findCell(Foam::dimensionedVector&)'
/home/sea/OpenFOAM/OpenFOAM-1.5/src/OpenFOAM/lnInclude/primitiveMesh.H:662: note: candidates are: Foam::label Foam::primitiveMesh::findCell(const Foam::point&) const

The compiler trys to tell you that your variable sp of type dimensionedVector cannot automatically converted into a point. Try sp.value(). (Vectors can be converted into points)

Henrik

seiji_adachi December 1, 2008 05:14

Dear Henrik, Thank you very
 
Dear Henrik,

Thank you very much for your reply.

Now I understand the difference between point(=vector) and dimensionedVector. The latter has a name and dimensions in addition to its value. This is why value() is needed to extract the value here. I made the same mistake at line 19. The code was rewrote as follows and it worked!

------------------------------------------------
// Add value of 1/v to deltaFunc at the point of sp!!!
label celli(mesh.findCell(sp.value()));
dimensionedScalar vol = mesh.V()[celli];
deltaFunc[celli] = 1.0/vol.value();
------------------------------------------------

Cheers,

Seiji


All times are GMT -4. The time now is 23:08.