|
[Sponsors] |
July 27, 2007, 03:02 |
Hello everyone,
in my solve
|
#1 |
New Member
Thomas Gallinger
Join Date: Mar 2009
Posts: 28
Rep Power: 17 |
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 |
|
July 27, 2007, 03:25 |
Hi Thomas,
Have you test to
|
#2 |
New Member
Martin Karlsson
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 13
Rep Power: 17 |
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 |
|
July 27, 2007, 04:02 |
Hi Martin,
thanks for your
|
#3 |
New Member
Thomas Gallinger
Join Date: Mar 2009
Posts: 28
Rep Power: 17 |
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? |
|
July 27, 2007, 04:20 |
Sorry for the last prosting.
|
#4 |
New Member
Thomas Gallinger
Join Date: Mar 2009
Posts: 28
Rep Power: 17 |
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! |
|
August 14, 2008, 09:30 |
Hi,
I have trouble with a s
|
#5 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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 |
|
August 14, 2008, 10:37 |
It seems that I can reread the
|
#6 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
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 |
|
February 17, 2011, 05:25 |
|
#7 |
New Member
Join Date: Jan 2011
Posts: 6
Rep Power: 15 |
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. Last edited by aPostrophic; February 17, 2011 at 17:49. |
|
February 18, 2011, 18:40 |
|
#8 |
New Member
Join Date: Jan 2011
Posts: 6
Rep Power: 15 |
Does anybody know how i can set the velocity in ( pointMotionU) for a special point on a patch?
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Cmu change | selçuk ataş | FLUENT | 2 | July 19, 2017 13:24 |
How to change Prt | Gu Hanyang | CFX | 0 | September 28, 2008 15:28 |
Looking for a change. | Sunil | Main CFD Forum | 0 | May 9, 2006 10:50 |
change the | Junyan | FLUENT | 0 | July 2, 2002 03:46 |
Air Change | Diogo Bolster | CFX | 3 | January 10, 2002 15:58 |