Mesh refinement variables outside pgen file #627
-
Is InitMeshBlock run before the refinement and update of the pcoord register? I am needing to interpolate external data into a rusermeshblock for each block. Using refinement, static or adaptive, the mesh grids will change from the initial values, and I need the updated dx1 etc. but it seems they aren't updated in the register. A work around is to create public function for meshblock to get out current_level etc. and manually calculate dx1 and x1v etc. for the refined block but I assume I have missed a nuance somewhere. Am I missing the refined block's coordinate registers somewhere? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Coordinates are calculated in the MeshBlock constructor, so they are properly set after immediately refinement. Then InitUserMeshBlockData is also called in the constructor. So you should have everything you need. FYI, you can get the level and logical positions from pmb->loc. |
Beta Was this translation helpful? Give feedback.
Coordinates are calculated in the MeshBlock constructor, so they are properly set after immediately refinement. Then InitUserMeshBlockData is also called in the constructor. So you should have everything you need.
FYI, you can get the level and logical positions from pmb->loc.