-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Naming and storage convention for grid information #91
Comments
I generally like the idea of keeping all the field-relevant info inside field, absolutely makes sense. I think the only criticism I have is the number of field types. Just to clarify, the type of a field (e.g. VERT, CELL, etc) is intended to:
Right? Do we necessarily need X_EDGE, Z_FACE, etc, for these purposes? I'm wary of over-complicating this. Maybe it's necessary for the allocator to allocate the correct size of underlying array, but if we're talking about allocating slightly different sized arrays, should we be thinking about not using the pool allocator? I do think NULL is useful for situations where you just need an array and you don't care about its grid representation. On an implementation level, I'm wary of tying the tdsops class to the allocator, especially in circumstances where the desired array won't interact with the tridiagonal system. But maybe we just have two different allocate calls, one for a "tridiagonal array" and another for just plain ol data. Generally in favour though, we can always start with this, see how it works and amend as needed. |
Two minor points before the main issue regarding
My concerns about My understanding is that there are very few locations in the codebase where we need to obtain the correct number of meaningful data points along a Just so that we have a better picture, and justify the added complexity, would you be able to point out a few places where And if we realise that the use cases of |
Yes, it stores the type so it can be checked and also sets the different sizes so that they align with the data we are storing in this array. There is no
The arrays are always allocated to the same size, only their dimensions (
I understand that, I think it will only be the initialisation that will get some information from tdsops. But we can have ways to 'bypass it' and explicitely put other values if needed |
@semi-h in the iterative solver we need to setup vectors for the solver (at the moment) which requires knowing the (local) size of the fields, currently this information seems to be divided between |
If we don't want to add this information to the fields, can I suggest a |
I think a |
OK - @Nanoseb do you think that will also address the issues you have? I see this working like
What do others think? The |
I like the idea of having a mesh object, it is definitely an improvement compared to the current situation. But it does not address everything. Mainly, you will need to know if you are working on a x,y or z field and what kind of field when needing What about we keep the possibility of storing the This implies that we still record the type when requesting If we are concerned by the added overhead on the code to record the |
I think it is a very good idea to have the proposed I also think it is a good idea to be able to store the One suggestion for the terminology: instead of calling where the data lives |
Great, it is nice to have a consensus. |
What
Currently the code stores information about the grid dimensions in various locations, e.g. SZ in
common.f90
, local length of something is stored inxdirps%n
, number of blocksxdirps%nblocks
. Padded versions of these are stored inallocator%xdims_padded(3)
. A field stores its direction/orientation infield_t%dir
but no size information. Accessing this all together at the point of use is difficult and requires bringing multiple objects together.Proposed solution
Fields should store their local and padded size, and their grid type (vertex, cell, face, edge centred) which ensures that the sizes are correct for their use.
The
get_block
subroutine will also take the field "type" in addition to the direction. This will allow it to set the local and padded dimensions according to the field's grid type and orientation. Suggested types are:VERT
(velocity grid)CELL
(pressure grid)X_EDGE
x-oriented edge (interpolation / derivative to/from velocity/pressure along x)Z_FACE
z-normal oriented face (interpolation / derivative to/from velocity/pressure along y)Y_EDGE
,Z_EDGE
- reserved but unusedX_FACE
,Y_FACE
- reserved but unusedNULL
- no specified grid location - is this necessary???A field's size will depend on where in the tridiagonal system its block is, boundary blocks will have different sizes from internal blocks, however after creation the field doesn't need to know its location, only its size.
The allocator will take
tdsops_t
(X/Y/Z) as arguments on initialisation, this will allow it to determine where in the grid it is, and use this information at field creation time.Summary
private
, preventing direct access to them and addressing concerns about them becoming invalid. In theNULL
field case only the setter will allow changing these, otherwise it is an invalid call and causes anerror stop
.The text was updated successfully, but these errors were encountered: