Comments (3)
Update: the flag field is actually properly communicated, but we never wrote a communicator for the bounce-back velocity map, and the slice update function doesn't automatically recompute the IndexInfo
vectors when only the ghost layer of the flag field is modified.
from espresso.
The node setters have the exact same bug. This is an issue for circular Couette flow, which are set up by node setters.
from espresso.
Here is my understanding so far: we must always run a full communication after each call to a node setter or slice setter. This is already the case for the velocity, force, flag and population fields, but not for the UBB map. We cannot introduce a flag to track pending changes introduced by setter functions and trigger a ghost communication whenever a getter function is called, because this would break the constness of the getters, and would also require a mechanism to synchronize the state of the flag between all MPI ranks, which is tedious since we don't include MPI header files. In addition, there are valid use cases for getting the state of the ghost layer before the ghost update, for example during particle coupling where the particle force is interpolated on the fluid while the fluid force is interpolated on the particle.
For completeness, here is how the pending status flag would have worked:
class LBWalberlaImpl {
/** Flags for pending ghost layer communication. */
enum PendingGhostLayerCommunicationFlag : unsigned int {
/** No pending field update. */
PENDING_COMM_NONE = 0u,
/** Pending changes to pdf/velocity/force fields. */
PENDING_COMM_GHOST = 1u,
/** Pending changes to boundary fields. */
PENDING_COMM_BOUNDARY = 2u,
};
unsigned int m_pending_changes = PENDING_COMM_NONE;
public:
void ghost_communication() override {
if (m_pending_changes & PENDING_COMM_BOUNDARY) {
reallocate_ubb_field();
ghost_communication_boundary();
ghost_communication_pdfs();
} else if (m_pending_changes & PENDING_COMM_GHOST) {
ghost_communication_pdfs();
}
}
void ghost_communication_boundary() {
m_boundary_communicator->communicate();
m_pending_changes &= ~PENDING_COMM_BOUNDARY;
}
void ghost_communication_pdfs() {
m_pdfs_communicator->communicate();
m_pending_changes &= ~PENDING_COMM_GHOST;
}
bool set_node_velocity(Utils::Vector3i const &node, Utils::Vector3d const &vel) {
m_pending_changes |= PENDING_COMM_GHOST;
auto bc = get_block_and_cell(get_lattice(), node, false);
if (bc) {
/* ... */
}
return bc.has_value();
}
};
from espresso.
Related Issues (20)
- CI build failed for merged PR HOT 1
- Velocity Verlet step in documentation has a typo HOT 3
- CI build failed for merged PR HOT 1
- Implement a Metatensor adaptor HOT 2
- LB: velocity updated missing in population and force setters
- LB/Virtual sites: incomplete API change HOT 1
- Lost virtual particle propagation flag after checkpointing HOT 1
- CI build failed for merged PR
- has_checkpoint overlooking existing checkpoint not indexed 0 HOT 2
- Particle image box is wrong with Verlet lists HOT 2
- Guard against unused arguments in script interfae HOT 2
- CI build failed for merged PR
- Ccache partial support for `-Xcompiler`
- P3M: further refactoring
- CI build failed for merged PR HOT 1
- CI build failed for merged PR HOT 2
- CI build failed for merged PR
- Decide api for system-wide propagation setup
- py: Allow passing ParticleHanlde and Particle Slice to observables
- CI build failed for merged PR HOT 1
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 espresso.