2015-06-03 19:06:43 +00:00
|
|
|
//============================================================================
|
|
|
|
// Copyright (c) Kitware, Inc.
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE.txt for details.
|
|
|
|
// This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
// PURPOSE. See the above copyright notice for more information.
|
|
|
|
//
|
|
|
|
// Copyright 2015 Sandia Corporation.
|
|
|
|
// Copyright 2015 UT-Battelle, LLC.
|
|
|
|
// Copyright 2015 Los Alamos National Security.
|
|
|
|
//
|
|
|
|
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
|
|
|
|
// the U.S. Government retains certain rights in this software.
|
|
|
|
//
|
|
|
|
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
|
|
|
|
// Laboratory (LANL), the U.S. Government retains certain rights in
|
|
|
|
// this software.
|
|
|
|
//============================================================================
|
2015-04-15 16:43:12 +00:00
|
|
|
#ifndef vtk_m_cont_CellSetStructured_h
|
|
|
|
#define vtk_m_cont_CellSetStructured_h
|
|
|
|
|
|
|
|
#include <vtkm/cont/CellSet.h>
|
2015-05-15 19:29:55 +00:00
|
|
|
#include <vtkm/RegularConnectivity.h>
|
2015-07-31 19:59:37 +00:00
|
|
|
#include <vtkm/TopologyElementTag.h>
|
2015-07-31 21:48:06 +00:00
|
|
|
#include <vtkm/internal/ConnectivityStructuredInternals.h>
|
2015-04-15 16:43:12 +00:00
|
|
|
|
|
|
|
namespace vtkm {
|
|
|
|
namespace cont {
|
|
|
|
|
2015-05-14 16:22:39 +00:00
|
|
|
|
2015-05-28 20:49:40 +00:00
|
|
|
|
|
|
|
template<vtkm::IdComponent DIMENSION>
|
2015-05-12 18:57:18 +00:00
|
|
|
class CellSetStructured : public CellSet
|
2015-04-15 16:43:12 +00:00
|
|
|
{
|
2015-05-15 17:15:11 +00:00
|
|
|
public:
|
2015-07-28 23:33:52 +00:00
|
|
|
static const vtkm::IdComponent Dimension=DIMENSION;
|
2015-05-12 18:57:18 +00:00
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
VTKM_CONT_EXPORT
|
2015-07-30 18:55:24 +00:00
|
|
|
CellSetStructured(const std::string &name = std::string())
|
2015-07-12 16:05:47 +00:00
|
|
|
: CellSet(name,Dimension)
|
2015-05-12 18:57:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
virtual vtkm::Id GetNumCells() const
|
2015-05-12 18:57:18 +00:00
|
|
|
{
|
2015-07-12 16:05:47 +00:00
|
|
|
return this->Structure.GetNumberOfCells();
|
2015-05-12 18:57:18 +00:00
|
|
|
}
|
|
|
|
|
2015-07-31 19:59:37 +00:00
|
|
|
template<typename FromTopology, typename ToTopology>
|
2015-07-28 23:33:52 +00:00
|
|
|
struct ConnectivityType {
|
2015-07-31 19:59:37 +00:00
|
|
|
VTKM_IS_TOPOLOGY_ELEMENT_TAG(FromTopology);
|
|
|
|
VTKM_IS_TOPOLOGY_ELEMENT_TAG(ToTopology);
|
2015-07-28 23:33:52 +00:00
|
|
|
typedef vtkm::RegularConnectivity<FromTopology,ToTopology,Dimension> Type;
|
|
|
|
};
|
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
VTKM_CONT_EXPORT
|
2015-07-31 19:59:37 +00:00
|
|
|
vtkm::RegularConnectivity<
|
|
|
|
vtkm::TopologyElementTagPoint,vtkm::TopologyElementTagCell,Dimension>
|
2015-07-12 16:05:47 +00:00
|
|
|
GetNodeToCellConnectivity() const
|
2015-05-15 17:15:11 +00:00
|
|
|
{
|
2015-07-31 19:59:37 +00:00
|
|
|
typedef vtkm::RegularConnectivity<vtkm::TopologyElementTagPoint,
|
|
|
|
vtkm::TopologyElementTagCell,
|
2015-05-28 20:49:40 +00:00
|
|
|
Dimension> NodeToCellConnectivity;
|
2015-07-12 16:05:47 +00:00
|
|
|
return NodeToCellConnectivity(this->Structure);
|
2015-05-18 15:04:15 +00:00
|
|
|
}
|
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
VTKM_CONT_EXPORT
|
2015-07-31 19:59:37 +00:00
|
|
|
vtkm::RegularConnectivity<
|
|
|
|
vtkm::TopologyElementTagCell,vtkm::TopologyElementTagPoint,Dimension>
|
2015-07-12 16:05:47 +00:00
|
|
|
GetCellToNodeConnectivity() const
|
2015-05-18 15:04:15 +00:00
|
|
|
{
|
2015-07-31 19:59:37 +00:00
|
|
|
typedef vtkm::RegularConnectivity<vtkm::TopologyElementTagCell,
|
|
|
|
vtkm::TopologyElementTagPoint,
|
2015-05-28 20:49:40 +00:00
|
|
|
Dimension> CellToNodeConnectivity;
|
2015-07-12 16:05:47 +00:00
|
|
|
return CellToNodeConnectivity(this->Structure);
|
2015-05-15 17:15:11 +00:00
|
|
|
}
|
|
|
|
|
2015-07-12 16:05:47 +00:00
|
|
|
virtual void PrintSummary(std::ostream &out) const
|
2015-05-20 19:26:10 +00:00
|
|
|
{
|
2015-07-12 16:05:47 +00:00
|
|
|
out << " StructuredCellSet: " << this->GetName()
|
|
|
|
<< " dim= " << this->GetDimensionality() << std::endl;
|
|
|
|
this->Structure.PrintSummary(out);
|
2015-05-20 19:26:10 +00:00
|
|
|
}
|
|
|
|
|
2015-05-15 17:15:11 +00:00
|
|
|
public:
|
2015-07-31 21:48:06 +00:00
|
|
|
vtkm::internal::ConnectivityStructuredInternals<Dimension> Structure;
|
2015-04-15 16:43:12 +00:00
|
|
|
};
|
|
|
|
|
2015-05-28 20:49:40 +00:00
|
|
|
|
2015-04-15 16:43:12 +00:00
|
|
|
}
|
|
|
|
} // namespace vtkm::cont
|
|
|
|
|
|
|
|
#endif //vtk_m_cont_CellSetStructured_h
|