clawpack / visclaw

Clawpack visualization tools
http://www.clawpack.org
BSD 3-Clause "New" or "Revised" License
29 stars 48 forks source link

Added more compatibility with 3d gauges. #151

Closed cjvogl closed 9 years ago

cjvogl commented 9 years ago

Added num_dim and additional printing code to account for 3rd dimension when using 3d gauges.

mandli commented 9 years ago

Is there anyway to avoid adding num_dim to the constructor?

rjleveque commented 9 years ago

getgauge doesn't need to know num_dim for reading fort.gauges since this always has the same format regardless of the number of dimensions. We only need num_dim for reading or printing the gauge locations and it seems like it should be possible to simplify things if we refactor a bit, and use things like gauge[1:-2]. I'd prefer to avoid adding this argument to getgauge.

cjvogl commented 9 years ago

While we could definitely get around using num_dim in getgauge to read the fort.gauges file, per your suggestion, I think there needs to be some way to tell the underlying GaugeData object that the gauges are 3D (visclaw/data.py:292) when reading the gauges.data file. In particular, the write() (amrclaw/data.py:226) and read() (amrclaw/data.py:253) of GaugeData currently rely on GaugeData.num_dim... which is set to a default value of 2 in init().

rjleveque commented 9 years ago

I think we can avoid this by using the version in clawpack/amrclaw#128.

cjvogl commented 9 years ago

That version in clawpack/amrclaw#128 looks good to me. I'll remove all mentions of num_dim from this PR.

cjvogl commented 9 years ago

This should be all set now. My apologies for the confusion while I get over the learning curve for the structure of clawpack and using github PRs

rjleveque commented 9 years ago

No worries, this is going as smoothly as any multi-repository set of changes and discussions could go...