View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000638OpenFOAM[All Projects] Bugpublic2012-08-29 22:002013-03-20 14:28
Assigned Touser4 
PlatformLinuxOSOpenSUSEOS Version11.4
Product Version 
Target VersionFixed in Version 
Summary0000638: polyMesh::updateMesh(const mapPolyMesh&) fails to update pointFields
DescriptionI was testing the combination of motionSolvers and refinement and found that that the pointFields in the object registry aren't updated as they should be.
Steps To Reproduce1. Unpack and compile solver sprayDyMFoam
2. Unpack and compile library dynamicMotionSolverRefineFvMesh
3. Unpack and run sprayDyMFoam on aachenBombMoveRefine

You will notice that pointMotionUy is not mapped when updateMesh is called.
Additional InformationI tried to manually map the fields inside the dynamicMotionSolverRefineFvMesh::refine and ::unrefine functions by:

pointMesh motionUpdate(*this);

where map is the mapPolyMesh returned after the refinement (but it could be any topology change). Now the mapping is attempted, but fails with:

Not mapping point<Type>Field fieldName since originating mesh differs from that of mapper.

As pointed out in the following thread, this may be an issue with pointer inconsistency: [^]
TagsNo tags attached.
Attached Filesgz file icon aachenBombMoveRefine.tar.gz [^] (6,232 bytes) 2012-08-29 22:00
gz file icon sprayDyMFoam.tar.gz [^] (4,138 bytes) 2012-08-29 22:01
gz file icon dynamicMotionSolverRefineFvMesh.tar.gz [^] (9,227 bytes) 2012-08-29 22:01
? file icon setFieldsDict [^] (1,238 bytes) 2012-08-30 18:32 [Show Content]
? file icon topoSetDict [^] (10,146 bytes) 2012-08-30 18:32 [Show Content]
? file icon log.sprayDyMFoam [^] (86,957 bytes) 2012-08-31 18:37
gz file icon log.sprayDyMFoam.gz [^] (523,859 bytes) 2012-09-04 15:04

- Relationships

-  Notes
2012-08-30 08:09

Can you try e.g. refineHexMesh? This should read and map pointScalarFields and pointVectorFields. Just create a blockMesh, create a cellSet and put a pointScalarField in the 0 directory.

     refineHexMesh <cellSet>
2012-08-30 17:13

Just tried and refineHexMesh has the same problem. The pointMesh gets deleted before mapping occurs.
mturcios (reporter)
2012-08-30 17:43
edited on: 2012-08-30 18:33

I was just about to post this but you beat my to it. Early morning meeting. Let me know if there are any other tests I can run to help with this.

I don't know if this will help, but when trying to use setFields on a pointScalarField, I get that the field is not supported. Exact error message is:

--> FOAM Warning :
    From function setCellField::iNew::operator()(Istream& is)
    in file setFields.C at line 156
    field type pointScalarFieldValue not currently supported
--> FOAM Warning :
    From function setCellField::iNew::operator()(Istream& is)
    in file setFields.C at line 156
    field type pointMotionUy not currently supported

I don't know if this is simply a syntax error in the setFieldsDict, I've uploaded it and the topoSetDict I used to create the cellSet

2012-08-31 10:48

In polyMeshClear.C can you try moving the pointMesh::Delete(*this) out of clearGeom() and clearAddressing() and into clearOut()? This will keep the pointMesh around during geometry and topology changes. It solves the refineHexMesh test but needs a bit more testing before I commit it.

2) correct, setFields does not support pointFields. Probably not hard to add. Do you see any use for it?
mturcios (reporter)
2012-08-31 18:37
edited on: 2012-08-31 18:40

Thanks, moving the call makes the mapping happen and the pointFields are mapped. The solver proceeeds for quite a few timesteps until the refinement engine performs an unrefinement, which leads to an error similar to the first time around:

Incompatible size before mapping. Field size: 42841 map size: 42917

    From function void MapInternalField<Type, MeshMapper, pointMesh>::operator()
    Field<Type>& field,
    const MeshMapper& mapper
) const
    in file lnInclude/MapPointField.H at line 79.

I think this may have to do with trying to do two consecutive topology change operations, as the refinement mapping alone seems to have no problems; I checked the created meshes and pointFields are created as they should be.

I don't know if this is still a problem with the polyMesh mapping or if it has to do with the way the dynamicRefine portions of the code do unrefinement. I've attached a complete log of the run.

2012-09-04 15:03

I've pushed 91aaca36bd39bef47bc74803961d07db1160d99c which in addition to that pointMesh deletion moved to clearOut also uses pointMesh::New to construct a pointMesh. Your sprayDyMFoam now runs past unrefinement - it only maps pointMotionUy once (attached log).
mturcios (reporter)
2012-09-04 17:34
edited on: 2012-09-04 18:18

Thanks Mattijs. The mapping is working now. Interesting about the temperature dropping; even though I have some custom libraries that handle that, I wonder if this is related to the timestep shrinking issue; I know that with smaller mesh size with refinement and movement I'll get a smaller timestep, but down to 1e-20 or so seems a bit excessive. Some more tests, when I find anything conclusive I'll report back.

mturcios (reporter)
2012-09-06 19:19

This issue can now be closed; it turns out the refinement operation should be carried out before the movement operation to keep the time step from plummetting. Somehow refining after movement causes the velocity field to increase by a ridiculous amount.

I'm now going to learn how to play with my shiny new toy...thanks for the responsiveness!

- Issue History
Date Modified Username Field Change
2012-08-29 22:00 mturcios New Issue
2012-08-29 22:00 mturcios File Added: aachenBombMoveRefine.tar.gz
2012-08-29 22:01 mturcios File Added: sprayDyMFoam.tar.gz
2012-08-29 22:01 mturcios File Added: dynamicMotionSolverRefineFvMesh.tar.gz
2012-08-30 08:09 user4 Note Added: 0001645
2012-08-30 17:13 user4 Note Added: 0001653
2012-08-30 17:43 mturcios Note Added: 0001655
2012-08-30 18:31 mturcios Note Edited: 0001655 View Revisions
2012-08-30 18:32 mturcios File Added: setFieldsDict
2012-08-30 18:32 mturcios File Added: topoSetDict
2012-08-30 18:33 mturcios Note Edited: 0001655 View Revisions
2012-08-31 10:48 user4 Note Added: 0001656
2012-08-31 18:37 mturcios Note Added: 0001667
2012-08-31 18:37 mturcios File Added: log.sprayDyMFoam
2012-08-31 18:40 mturcios Note Edited: 0001667 View Revisions
2012-09-04 15:03 user4 Note Added: 0001670
2012-09-04 15:04 user4 File Added: log.sprayDyMFoam.gz
2012-09-04 17:34 mturcios Note Added: 0001671
2012-09-04 18:10 mturcios Note Edited: 0001671 View Revisions
2012-09-04 18:18 mturcios Note Edited: 0001671 View Revisions
2012-09-06 19:19 mturcios Note Added: 0001676
2012-10-08 08:23 user2 Status new => resolved
2012-10-08 08:23 user2 Resolution open => fixed
2012-10-08 08:23 user2 Assigned To => user4