GravitatingMassFieldCellSize is the same for all directions

1 view
Skip to first unread message

James Larrue

unread,
Jun 19, 2015, 10:41:12 AM6/19/15
to enzo...@googlegroups.com
Hello,

Does anybody know why GravitatingMassFieldCellSize is the same for all directions?  I have a 3D simulation where two dimensions are very thin (TopGridDimensions = 500 2 2) and I get errors in a few places because GravitatingMassFieldCellSize = CellWidth[3][0], but GravitatingMassFieldLeftEdge[dim] is initialized based on CellWidth[dim][0].  For example, I get errors in grid::DepositBaryons and grid::CopyParentToGravitatingFieldBoundary.

The errors are likely only visible when you have a very thin domain, but it seems to me that the GravitatingMassFieldCellSize should be different for the different directions, or replaced by CellWidth[dim][0].

Can GravitatingMassFieldCellSize be replaced by CellWidth[dim][0]?

James

Daniel R. Reynolds

unread,
Jun 19, 2015, 11:20:52 AM6/19/15
to enzo...@googlegroups.com
Hi James,

This is based on some old assumptions in Enzo that required a uniform mesh for gravitational simulations.  I have seen many places in the code (especially in relation to gravity) where it is assumed that dx == dy == dz, so unless all of those locations can be identified/fixed, I don't think that your proposed change will be sufficient.

Perhaps this could be a topic for an upcoming Enzo-Dev workshop?

-Dan
 

-- 

 Daniel R. Reynolds
 Associate Professor
 Mathematics @ SMU
 214-768-4339
 http://faculty.smu.edu/reynolds/


--
You received this message because you are subscribed to the Google Groups "enzo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enzo-dev+u...@googlegroups.com.
To post to this group, send email to enzo...@googlegroups.com.
Visit this group at http://groups.google.com/group/enzo-dev.
For more options, visit https://groups.google.com/d/optout.

David Collins

unread,
Jun 19, 2015, 11:23:18 AM6/19/15
to enzo...@googlegroups.com
Hi, James--

Where in the code do you see that?  CellWidth[3][0] is a memory violation, so that's a significant problem.  I looked but don't see such a line in the code.

I agree with Dan that we should try to be rigorous about tracking such things down.

d.


--
You received this message because you are subscribed to the Google Groups "enzo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to enzo-dev+u...@googlegroups.com.
To post to this group, send email to enzo...@googlegroups.com.
Visit this group at http://groups.google.com/group/enzo-dev.
For more options, visit https://groups.google.com/d/optout.



--
-- Sent from a computer.

James Larrue-Baulch

unread,
Jun 19, 2015, 11:51:43 AM6/19/15
to enzo...@googlegroups.com
Sorry, I meant CellWidth[2][0].  GravitatingMassFieldCellSize is set in grid::InitializeGravitatingMassField, inside a loop "for (dim = 0; dim < GridRank; dim++)".  At the end of the loop, GravitatingMassFieldCellSize == CellSize[GridRank-1][0] and I found no location where it changed afterwards (using grep "GravitatingMassFieldCellSize\s*[\+\-\*\/]*=[^=]").  I am on Enzo 3.0.

James

James Larrue-Baulch

unread,
Jun 19, 2015, 11:57:36 AM6/19/15
to enzo...@googlegroups.com
Hi Dan,

I vote for putting it on the "to do list", in the appropriate priority position.

In the meantime, should one only run simulations with dx == dy == dz, or at least close to equal?

James

Daniel R. Reynolds

unread,
Jun 19, 2015, 12:04:11 PM6/19/15
to enzo...@googlegroups.com
Hi James,

If you want to use gravity, then I'd recommend having dx==dy==dz.  Perhaps someone else has a workaround, but as far as I know, if you run simulations without this criteria then the gravitational potential will be entirely incorrect.

-Dan


-- 

 Daniel R. Reynolds
 Associate Professor
 Mathematics @ SMU
 214-768-4339
 http://faculty.smu.edu/reynolds/


Nathan Goldbaum

unread,
Jun 19, 2015, 1:05:07 PM6/19/15
to enzo...@googlegroups.com
Perhaps it would be worthwhile to add some logic to hard crash the code if someone tries to do this in the future, at least until the underlying issue can be fixed.

Greg Bryan

unread,
Jun 19, 2015, 6:07:35 PM6/19/15
to enzo...@googlegroups.com
Yes, probably a good idea.  I don’t think it would be hard to fix the dx==dy==dz assumption.  Originally, the code was general, but in the switch to the multigrid method, I didn’t keep it up.  Sorry...

Greg
Reply all
Reply to author
Forward
0 new messages