24#if defined(__CUDACC__)
29#include "../utils/types_conversion.hpp"
31#include <core/math/Vector3.h>
32#include <domain_decomposition/BlockDataID.h>
33#include <domain_decomposition/IBlock.h>
42template <
typename PdfField,
typename ForceField>
class ResetForce {
43 using FloatType =
typename PdfField::value_type;
46 ResetForce(BlockDataID
const &last_applied_force_field_id,
47 BlockDataID
const &force_to_be_applied_id)
48 : m_last_applied_force_field_id(last_applied_force_field_id),
49 m_force_to_be_applied_id(force_to_be_applied_id),
50 m_ext_force(Vector3<FloatType>{0, 0, 0}) {}
53 m_ext_force = to_vector3<FloatType>(ext_force);
60 block->template getData<ForceField>(m_last_applied_force_field_id);
61 auto force_to_be_applied =
62 block->template getData<ForceField>(m_force_to_be_applied_id);
64 force_field->swapDataPointers(force_to_be_applied);
68 Vector3<FloatType>{0});
72 const BlockDataID m_last_applied_force_field_id;
73 const BlockDataID m_force_to_be_applied_id;
74 Vector3<FloatType> m_ext_force;
Vector implementation and trait types for boost qvm interoperability.
Sweep that swaps force_to_be_applied and last_applied_force and resets force_to_be_applied to the glo...
ResetForce(BlockDataID const &last_applied_force_field_id, BlockDataID const &force_to_be_applied_id)
void operator()(IBlock *block)
void set_ext_force(Utils::Vector3d const &ext_force)
Utils::Vector3d get_ext_force() const
static double * block(double *p, std::size_t index, std::size_t size)
void initialize(GhostLayerField< double, uint_t{3u}> *vec_field, Vector3< double > const &vec)
void add_to_all(GhostLayerField< double, uint_t{3u}> *vec_field, Vector3< double > const &vec)
\file PackInfoPdfDoublePrecision.cpp \author pystencils
Utils::Vector3d to_vector3d(Vector3< float > const &v)