Skip to content

Allow no bndry#485

Merged
bendudson merged 5 commits intoboutproject:nextfrom
dschwoerer:allow_no_bndry
Apr 12, 2017
Merged

Allow no bndry#485
bendudson merged 5 commits intoboutproject:nextfrom
dschwoerer:allow_no_bndry

Conversation

@dschwoerer
Copy link
Contributor

fix #477 by fixing #376

Now, if the domain has no guards, and only one cell, the derivative just returns 0.

This will allow 2d / 1d simulations using 3d fields.

If this is the way we want to go, than making sure boundaries aren't set, and also brackets aren't evaluated, would allow to run e.g. 1D simulations, without changing the equations, but just setting NY=1 and MYG=0 ...

@dschwoerer
Copy link
Contributor Author

Should I move the getters to field? (#498)
Or do you think this is the wrong way to approach this issue?

@JensMadsen
Copy link
Contributor

I do not understand how the private boutmesh variables nx, ny and nz are in the scope of the fields?

@dschwoerer
Copy link
Contributor Author

Because they are also private members of the fields:
https://github.com/boutproject/BOUT-dev/blob/master/include/field3d.hxx#L491
The comment is however a bit confusing, as they need to be valid, if the field has data:
https://github.com/boutproject/BOUT-dev/blob/master/include/field3d.hxx#L346

Also the loop operator uses these values:
https://github.com/boutproject/BOUT-dev/blob/master/src/field/field3d.cxx#L237

Further it makes sense that the field knows these values, as it is needs to know them, as otherwise it wouldn't be able to know the size of the data.

Note that nx etc. are not necessarily the same as for the mesh.
Field2D has e.g. always nz=1

@bendudson bendudson merged commit 9894b9b into boutproject:next Apr 12, 2017
@dschwoerer dschwoerer deleted the allow_no_bndry branch February 27, 2018 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants