Skip to content
Snippets Groups Projects
Commit dcb31edb authored by Cristian Lalescu's avatar Cristian Lalescu
Browse files

try suggested number_of_componentns alternative

parent 20c6ce71
No related branches found
No related tags found
No related merge requests found
Pipeline #44460 failed
......@@ -58,6 +58,7 @@ class field
private:
rnumber *__restrict__ data; /**< data array */
public:
static const int number_of_components = ncomp(fc);
hsize_t npoints; /**< total number of grid points. Useful for normalization. */
bool real_space_representation; /**< `true` if field is in real space representation. */
......
......@@ -12,16 +12,6 @@ template <class partsize_t,
class interpolator_class,
int interp_neighbours>
class particles_field_computer {
// TODO but not critical, add in field:
// static const int nb_components = ncomp(fc);
// and use it as field_class::nb_components
// but failed up to now....
template <typename rnumber,
field_backend be,
field_components fc>
static constexpr int nbcomp(const field<rnumber, be, fc>& /*field*/){
return ncomp(fc);
}
const std::array<int,3> field_grid_dim;
const std::pair<int,int> current_partition_interval;
......@@ -77,7 +67,7 @@ public:
const real_number particles_positions[],
real_number particles_current_rhs[],
const partsize_t nb_particles) const {
constexpr int nb_components_in_field = nbcomp(field);
constexpr int nb_components_in_field = field.number_of_components;
static_assert(nb_components_in_field <= size_particle_rhs, "Cannot store all the component in the given array");
TIMEZONE("particles_field_computer::apply_computation");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment