Skip to content

Commit d5dcf4c

Browse files
authored
ParticleContainerToBlueprint: Allocator (#4776)
## Summary Add the `Allocator` template, so we can use this with polymorphic PCs (and generally any PC that does not use the default allocator). ## Additional background BLAST-WarpX/warpx#6374 ## Checklist The proposed changes: - [ ] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate
1 parent 990d40c commit d5dcf4c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Src/Extern/Conduit/AMReX_Conduit_Blueprint.H

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ namespace amrex
9696
// coordset and fields used to represent the passed particle container.
9797
// This allows you to use unique names to wrap multiple particle containers
9898
// into a single blueprint tree.
99-
template <typename ParticleType, int NArrayReal, int NArrayInt>
99+
template <typename ParticleType, int NArrayReal, int NArrayInt, template<class> class Allocator=DefaultAllocator>
100100
void ParticleContainerToBlueprint (const ParticleContainer_impl<ParticleType,
101101
NArrayReal,
102-
NArrayInt> &pc,
102+
NArrayInt,
103+
Allocator> &pc,
103104
const Vector<std::string> &real_comp_names,
104105
const Vector<std::string> &int_comp_names,
105106
conduit::Node &bp_mesh,

Src/Extern/Conduit/AMReX_Conduit_Blueprint_ParticlesI.H

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,12 @@ ParticleTileToBlueprint(const ParticleTile<ParticleType,
244244
//---------------------------------------------------------------------------//
245245
// Converts a AMReX Particle Container into a Conduit Mesh Blueprint Hierarchy.
246246
//---------------------------------------------------------------------------//
247-
template <typename ParticleType, int NArrayReal, int NArrayInt>
247+
template <typename ParticleType, int NArrayReal, int NArrayInt, template<class> class Allocator=DefaultAllocator>
248248
void
249249
ParticleContainerToBlueprint(const ParticleContainer_impl<ParticleType,
250250
NArrayReal,
251-
NArrayInt> &pc,
251+
NArrayInt,
252+
Allocator> &pc,
252253
const Vector<std::string> &real_comp_names,
253254
const Vector<std::string> &int_comp_names,
254255
conduit::Node &res,

0 commit comments

Comments
 (0)