Hello everyone,
in my solve
Hello everyone,
in my solver I need to change the coordinates of a meshpoint during running. So I want to write something like: point pos; pos.x()=... pos.y()=... pos.z()=... mesh.points()[indexmesh] = pos; This gives me an compilation error, because mesh.point() is protected. Does someone know, how to assign and change the point coordiantes? Many Thanks Thomas |
Hi Thomas,
Have you test to
Hi Thomas,
Have you test to wrap the points from the data base? This might work (I haven't test it): pointField& points=const_cast<pointfield&>(mesh.objectRegistry ::lookupObject<pointfield>("po int")); //Message board might destroy this line. It should be pointField and not pointfield, point and not po int point pos; pos.x()=... pos.y()=... pos.z()=... points[indexmesh] = pos; Regards, Martin |
Hi Martin,
thanks for your
Hi Martin,
thanks for your reply! I just tested and compiling works, but while running Foam crashes with the following error: --> FOAM FATAL ERROR : request for Field point from objectRegistry region0 failed available objects of type Field are 0 ( ) From function objectRegistry::lookupObject<type>(const word&) const So, as I understand, the field "point" does not exist. Any suggestion? |
Sorry for the last prosting.
Sorry for the last prosting.
Just asking for "points" in the const_cast call solved the problem and now I can access the point coordinates. Again, thanks very much! |
Hi,
I have trouble with a s
Hi,
I have trouble with a similar approach during runtime: pointField newPointAdded = zeroPoints + newPoints; mesh.polyMesh::movePoints(newPointsmorphed); mesh.write(); The new mesh works, but for the calculation the mesh needs some kind of an update otherwise it crashes. Does anyone know, how to tell openfoam, that there exist a new mesh? Would be nice, if anyone has a hint!? Fabian |
It seems that I can reread the
It seems that I can reread the fields with the general 'createFields.H' (e.g. the one of simpleFoam) after defining the new points, but if this is done every iteration it could be time consuming. There is probably a more elegant way.
Fabian |
I had the same problem.
Just use createDynamicMesh.H instead of createMesh.H and mesh.fvMesh::movePoints(newPointsmorphed); instead of mesh.polyMesh::movePoints(newPointsmorphed) and it works. |
Does anybody know how i can set the velocity in ( pointMotionU) for a special point on a patch?
|
All times are GMT -4. The time now is 19:02. |