Code cleanup. Add some comments.

This commit is contained in:
Dave Pugmire 2022-08-24 09:47:31 -04:00
parent dc7b198541
commit f9dbfe9303
3 changed files with 6 additions and 7 deletions

@ -17,15 +17,11 @@
#include <vtkm/cont/Field.h>
#include <vtkm/cont/internal/FieldCollection.h>
#include <set>
namespace vtkm
{
namespace cont
{
//Should field data and methods be put into a base class for DataSet and PartitionedDataSet ???
class VTKM_CONT_EXPORT PartitionedDataSet
{
using StorageVec = std::vector<vtkm::cont::DataSet>;
@ -138,7 +134,7 @@ public:
VTKM_CONT void AddWholeMeshField(const std::string& fieldName,
const vtkm::cont::ArrayHandle<T, Storage>& field)
{
this->AddField(vtkm::cont::Field(vtkm::cont::Field::Association::WholeMesh, field));
this->AddField(vtkm::cont::Field(fieldName, vtkm::cont::Field::Association::WholeMesh, field));
}
template <typename T>

@ -46,6 +46,9 @@ vtkm::cont::Field& FieldCollection::GetField(vtkm::Id index)
vtkm::Id FieldCollection::GetFieldIndex(const std::string& name,
vtkm::cont::Field::Association assoc) const
{
// Find the field with the given name and association. If the association is
// `vtkm::cont::Field::Association::Any`, then the `Fields` object has a
// special comparator that will match the field to any association.
const auto it = this->Fields.find({ name, assoc });
if (it != this->Fields.end())
{

@ -24,8 +24,8 @@ class VTKM_CONT_EXPORT FieldCollection
{
public:
VTKM_CONT
FieldCollection(const std::set<vtkm::cont::Field::Association>& validAssoc)
: ValidAssoc(validAssoc)
FieldCollection(std::set<vtkm::cont::Field::Association>&& validAssoc)
: ValidAssoc(std::move(validAssoc))
{
}