ElementData.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
#ifndef __WEIPA_ELEMENTDATA_H__
#define __WEIPA_ELEMENTDATA_H__
#include <weipa/weipa.h>
#include <weipa/vtkCellType.h>
#include <ostream>
namespace weipa {
typedef enum {
ZONETYPE_UNKNOWN=0,
ZONETYPE_BEAM=VTK_LINE,
ZONETYPE_HEX=VTK_HEXAHEDRON,
ZONETYPE_POLYGON=VTK_POLYGON,
ZONETYPE_QUAD=VTK_QUAD,
ZONETYPE_TET=VTK_TETRA,
ZONETYPE_TRIANGLE=VTK_TRIANGLE
} ZoneType;
struct QuadMaskInfo {
std::vector<IntVec> mask;
IntVec factor;
};
class ElementData
{
public:
virtual void writeConnectivityVTK(std::ostream& os) = 0;
virtual StringVec getMeshNames() const = 0;
virtual StringVec getVarNames() const = 0;
virtual int getNumElements() const = 0;
virtual int getNodesPerElement() const = 0;
virtual int getGhostCount() const = 0;
virtual ZoneType getType() const = 0;
virtual const IntVec& getNodeList() const = 0;
virtual const IntVec& getIDs() const = 0;
virtual NodeData_ptr getNodes() const = 0;
virtual ElementData_ptr getReducedElements() const = 0;
virtual const QuadMaskInfo& getQuadMask(int fsCode) const = 0;
virtual int getElementFactor() const = 0;
protected:
virtual ~ElementData() {}
};
} // namespace weipa
#endif // __WEIPA_ELEMENTDATA_H__
weipa::ElementData
Stores and manipulates one type of domain elements.
Definition: ElementData.h:50
weipa::ElementData::getQuadMask
virtual const QuadMaskInfo & getQuadMask(int fsCode) const =0
Returns a QuadMaskInfo structure for given functionspace code.
weipa::ElementData::~ElementData
virtual ~ElementData()
Definition: ElementData.h:94
weipa::ElementData::getGhostCount
virtual int getGhostCount() const =0
Returns the number of "ghost" elements.
weipa::ElementData::getIDs
virtual const IntVec & getIDs() const =0
Returns a vector of element IDs.
weipa::ElementData::getNodeList
virtual const IntVec & getNodeList() const =0
Returns a vector of the node IDs used by the elements.
weipa::ElementData::getNumElements
virtual int getNumElements() const =0
Returns the number of elements.
weipa::ElementData::getType
virtual ZoneType getType() const =0
Returns the element type.
weipa::ElementData::getElementFactor
virtual int getElementFactor() const =0
If the original element type is not supported they are subdivided into N smaller elements (e....
weipa::ElementData::getMeshNames
virtual StringVec getMeshNames() const =0
Returns the names of the meshes associated with the elements.
weipa::ElementData::getNodesPerElement
virtual int getNodesPerElement() const =0
Returns the number of nodes per element.
weipa::ElementData::getReducedElements
virtual ElementData_ptr getReducedElements() const =0
Returns the reduced elements if available.
weipa::ElementData::getVarNames
virtual StringVec getVarNames() const =0
Returns a vector with the mesh variable names.
weipa::ElementData::getNodes
virtual NodeData_ptr getNodes() const =0
Returns the NodeData instance used by the elements.
weipa::ElementData::writeConnectivityVTK
virtual void writeConnectivityVTK(std::ostream &os)=0
Writes connectivity data to a stream in VTK text format.
weipa
Definition: DataVar.cpp:51
weipa::StringVec
std::vector< std::string > StringVec
Definition: weipa.h:61
weipa::ElementData_ptr
boost::shared_ptr< ElementData > ElementData_ptr
Definition: weipa.h:67
weipa::IntVec
std::vector< int > IntVec
Definition: weipa.h:60
weipa::NodeData_ptr
boost::shared_ptr< NodeData > NodeData_ptr
Definition: weipa.h:69
weipa::ZoneType
ZoneType
Definition: ElementData.h:27
weipa::ZONETYPE_UNKNOWN
@ ZONETYPE_UNKNOWN
Definition: ElementData.h:28
weipa::ZONETYPE_TRIANGLE
@ ZONETYPE_TRIANGLE
Definition: ElementData.h:34
weipa::ZONETYPE_QUAD
@ ZONETYPE_QUAD
Definition: ElementData.h:32
weipa::ZONETYPE_BEAM
@ ZONETYPE_BEAM
Definition: ElementData.h:29
weipa::ZONETYPE_HEX
@ ZONETYPE_HEX
Definition: ElementData.h:30
weipa::ZONETYPE_POLYGON
@ ZONETYPE_POLYGON
Definition: ElementData.h:31
weipa::ZONETYPE_TET
@ ZONETYPE_TET
Definition: ElementData.h:33
weipa::QuadMaskInfo
This struct holds a mask (0's and 1's) that indicates which quad nodes contribute to a sub-element wh...
Definition: ElementData.h:40
weipa::QuadMaskInfo::mask
std::vector< IntVec > mask
Definition: ElementData.h:41
weipa::QuadMaskInfo::factor
IntVec factor
Definition: ElementData.h:42
VTK_HEXAHEDRON
#define VTK_HEXAHEDRON
Definition: vtkCellType.h:48
VTK_LINE
#define VTK_LINE
Definition: vtkCellType.h:39
VTK_POLYGON
#define VTK_POLYGON
Definition: vtkCellType.h:43
VTK_QUAD
#define VTK_QUAD
Definition: vtkCellType.h:45
VTK_TRIANGLE
#define VTK_TRIANGLE
Definition: vtkCellType.h:41
VTK_TETRA
#define VTK_TETRA
Definition: vtkCellType.h:46