Comments (5)
There are a number of mesh::actions that need to be applied that may be required only when creating the functionspace::NodeColumns
Other mesh actions may be required when creating functionspace::EdgeColumns
I understand it is unexpected. I have struggled to find a good way.
At the point of mesh-creation you may not yet have the logic to what you want to do with it, as that may depend on a configurable numerical method chosen.
One should use NodeColumns::size()
, which would be what you expect.
Creating subsequently another NodeColumns
with smaller halo should also return what you expect.
from atlas.
Maybe a function like
atlas::functionspace::NodeColumns enableNodeColumns(mesh, [options]);
would make it more obvious that the mesh changes.
At the point of mesh-creation you may not yet have the logic to what you want to do with it, as that may depend on a configurable numerical method chosen.
Are there useful operations you could already do with the mesh, before you have a functionsspace on it? Why do you want to create the mesh before you have all required information on how you want to construct it?
Of course, the code I am dealing with are very simple standalone examples, so I don't see the complication you might encounter when implementing a full model.
from atlas.
I have considered your proposed function enableNodeColumns
versus a NodeColumns
constructor, and in the end the API would be the same, bar a different name.
The paradigm of having it in a constructor is that the functionspace object is always created correctly and does not depend on a disjoint creator function.
The mesh should be seen as a more heavy mutable datastructure in support for various function spaces. The Finite Volume scheme e.g. requires 2 functionspaces: NodeColumns
, functionspace::EdgeColumns
.
Atlas provides a 'fvm::Method', which taken a mesh and options, constructs both function spaces within its Method
object. Again the mesh will be adapted.
I may have to document all this better and more clearly
All this said, the functionspace::NodeColumns::size()
function, when created with the right halo option, should return you just the number of points in the mesh including the right halo.
Halo's in the mesh are currently always constructed incrementally so node numbering for each halo is following the previous halo nodes. This allows for multiple functionspace::NodeColumns
instances with different halos to use the same mesh
from atlas.
I have considered your proposed function enableNodeColumns versus a NodeColumns constructor, and in the end the API would be the same, bar a different name.
There is a big difference: enableNodeColumns
documents its side-effect in the name. A side-effect on an argument of a constructor is maximally hidden.
All this said, the functionspace::NodeColumns::size() function, when created with the right halo option, should return you just the number of points in the mesh including the right halo.
Halo's in the mesh are currently always constructed incrementally so node numbering for each halo is following the previous halo nodes. This allows for multiple functionspace::NodeColumns instances with different halos to use the same mesh
I think I understand the concept of functionspace much better now. I was thinking of it as an object which just creates fields. But it is more, it also defines the iteration space on a mesh. In my use-case I don't want to create fields, just iterate over all nodes and access neighbors. This should be done via the function space, not the Mesh.nodes()
, right?
If that's right, maybe Mesh.nodes()
(and all other methods of Mesh
which expose the side effect of the functionspace constructor) could be made private? Then I would be less concerned with this pattern.
from atlas.
And what about the functions to get metric fields, like Mesh.nodes().field("dual_volumes")
? Can I get this field via a functionspace? Because with my new understanding of functionspace, I should be able to get this field with different number of halos, depending on the function space.
from atlas.
Related Issues (20)
- Regional matching mesh partitioning HOT 2
- Set UnstructuredGrid in meshes built by MeshBuilder HOT 9
- Ctest failure in atlas_fctest_trans HOT 1
- Adding robust vector-field interpolation functionality (current PR and further work). HOT 1
- `Field.levels()` is expensive HOT 3
- Interpolation::NonLinear datatype incompatible with atlas::Fieldsets of heterogeneous types HOT 1
- StructuredColumns `FixupHaloForVectors` method interferes with `SphericalVector` interpolation HOT 7
- Cannot find ectrans header HOT 4
- Improve performance of missing-values-containing field interpolation
- Outermost mpi::Scope does not restore prior communicator HOT 8
- Using serial Partitioner on multiple ranks leads to unexpected duplication of FunctionSpace HOT 3
- Failed to find nvcc. HOT 2
- Compile failure with NAG HOT 1
- Risk of surprising behavior when adding multiple Fields of same name into FieldSet HOT 10
- Missing halos after calling build_halo on a "structured" mesh HOT 2
- Failure in atlas_test_trans HOT 1
- Some interpolators fail with zero-sized target functionspace.
- Some issues with NAG compiler
- The test "atlas_fctest_field_host" fails with "ENABLE_CUDA" build option HOT 2
- Allow vector interpolation methods to pack and unpack vector fields.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atlas.