diff options
author | 2020-01-07 17:04:51 -0800 | |
---|---|---|
committer | 2020-01-07 17:04:51 -0800 | |
commit | cddb7b7ceac213b1432ce97a3828ac0ee885ffeb (patch) | |
tree | 43b9ee58ea8c7428d130eb1cc2eb0c1a9afc0c58 /Source/Particles/ParticleCreation/SmartCopy.H | |
parent | 0fec87cd1518fc2398f7f0440e0fa14a0896d86a (diff) | |
download | WarpX-cddb7b7ceac213b1432ce97a3828ac0ee885ffeb.tar.gz WarpX-cddb7b7ceac213b1432ce97a3828ac0ee885ffeb.tar.zst WarpX-cddb7b7ceac213b1432ce97a3828ac0ee885ffeb.zip |
add code for computing common components in smart copy
Diffstat (limited to 'Source/Particles/ParticleCreation/SmartCopy.H')
-rw-r--r-- | Source/Particles/ParticleCreation/SmartCopy.H | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Particles/ParticleCreation/SmartCopy.H b/Source/Particles/ParticleCreation/SmartCopy.H new file mode 100644 index 000000000..f60e2aba3 --- /dev/null +++ b/Source/Particles/ParticleCreation/SmartCopy.H @@ -0,0 +1,21 @@ +#ifndef SMART_COPY_H_ +#define SMART_COPY_H_ + +#include <map> +#include <string> +#include <vector> + +using NameMap = std::map<std::string, int>; + +struct SmartCopyTag +{ + std::vector<std::string> common_names; + std::vector<int> src_comps; + std::vector<int> dst_comps; + + int size () const noexcept { return common_names.size(); } +}; + +SmartCopyTag getSmartCopyTag (const NameMap& src, const NameMap& dst); + +#endif |