NeoPZ
Public Types | Public Member Functions | Protected Attributes | List of all members
TPZChunkVector< T, EXP > Class Template Reference

#include <TPZStream.h>

Inheritance diagram for TPZChunkVector< T, EXP >:
[legend]
Collaboration diagram for TPZChunkVector< T, EXP >:
[legend]

Public Types

typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef TPZChunkVectorIterator< false, value_type, EXP > iterator
 
typedef TPZChunkVectorIterator< true, value_type, EXP > const_iterator
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef int64_t size_type
 

Public Member Functions

TPZChunkVector< T, EXP > & operator= (const TPZChunkVector< T, EXP > &TCh)
 Assignment operator, copies all elements from the object TCh. More...
 
 TPZChunkVector (const TPZChunkVector< T, EXP > &TCh)
 Copy constructor. More...
 
 TPZChunkVector (int64_t numberofchunks=DEFAULTNUMBEROFCHUNKS)
 Constructor with numberofchunks chunks. More...
 
virtual ~TPZChunkVector ()
 Destructor. More...
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
int64_t NElements () const
 Access method to query the number of elements of the vector. More...
 
void Resize (const int64_t newsize)
 Increase the size of the chunk vector. More...
 
T & operator[] (const int64_t nelem) const
 Returns a reference to the ith element of the vector. More...
 
int64_t FindObject (T *object)
 Finds the index of an object by its pointer. More...
 
int ClassId () const override
 Define the class id associated with the class. More...
 
void Read (TPZStream &buf, void *context) override
 read objects from the stream More...
 
void Write (TPZStream &buf, int withclassid) const override
 Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More...
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
virtual bool Compare (TPZSavable *copy, bool override=false)
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const
 Compares the object for identity with the object pointed to, eventually copy the object. More...
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Protected Attributes

int64_t fNElements
 Number of elements of the chunk vector. More...
 
TPZManVector< T * > fVec
 Vector which points to each chunk of objects. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 

Detailed Description

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
class TPZChunkVector< T, EXP >

The expansion of a TChunkVector object does not involve the copying of the already allocated objects.

Definition at line 36 of file TPZStream.h.

Member Typedef Documentation

◆ const_iterator

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef TPZChunkVectorIterator<true, value_type, EXP> TPZChunkVector< T, EXP >::const_iterator

Definition at line 183 of file TPZChunkVector.h.

◆ const_pointer

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef const value_type* TPZChunkVector< T, EXP >::const_pointer

Definition at line 181 of file TPZChunkVector.h.

◆ const_reference

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef const value_type& TPZChunkVector< T, EXP >::const_reference

Definition at line 185 of file TPZChunkVector.h.

◆ iterator

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef TPZChunkVectorIterator<false, value_type, EXP> TPZChunkVector< T, EXP >::iterator

Definition at line 182 of file TPZChunkVector.h.

◆ pointer

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef value_type* TPZChunkVector< T, EXP >::pointer

Definition at line 180 of file TPZChunkVector.h.

◆ reference

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef value_type& TPZChunkVector< T, EXP >::reference

Definition at line 184 of file TPZChunkVector.h.

◆ size_type

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef int64_t TPZChunkVector< T, EXP >::size_type

Definition at line 186 of file TPZChunkVector.h.

◆ value_type

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
typedef T TPZChunkVector< T, EXP >::value_type

Definition at line 179 of file TPZChunkVector.h.

Constructor & Destructor Documentation

◆ TPZChunkVector() [1/2]

template<class T, int EXP>
TPZChunkVector< T, EXP >::TPZChunkVector ( const TPZChunkVector< T, EXP > &  TCh)

Copy constructor.

Parameters
TChThe elements of the current object will be copied from TCh.

Definition at line 393 of file TPZChunkVector.h.

◆ TPZChunkVector() [2/2]

template<class T, int EXP>
TPZChunkVector< T, EXP >::TPZChunkVector ( int64_t  numberofchunks = DEFAULTNUMBEROFCHUNKS)

Constructor with numberofchunks chunks.

Parameters
numberofchunksIndicates how large the initial chunk vector will be.

Definition at line 292 of file TPZChunkVector.h.

◆ ~TPZChunkVector()

template<class T , int EXP>
TPZChunkVector< T, EXP >::~TPZChunkVector ( )
virtual

Destructor.

Definition at line 304 of file TPZChunkVector.h.

Member Function Documentation

◆ begin() [1/2]

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
iterator TPZChunkVector< T, EXP >::begin ( )
inline

Definition at line 208 of file TPZChunkVector.h.

Referenced by TPZGeoMesh::FindCloseElement().

◆ begin() [2/2]

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
const_iterator TPZChunkVector< T, EXP >::begin ( ) const
inline

Definition at line 212 of file TPZChunkVector.h.

◆ cbegin()

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
const_iterator TPZChunkVector< T, EXP >::cbegin ( ) const
inline

Definition at line 216 of file TPZChunkVector.h.

◆ cend()

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
const_iterator TPZChunkVector< T, EXP >::cend ( ) const
inline

Definition at line 228 of file TPZChunkVector.h.

◆ ClassId()

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
int TPZChunkVector< T, EXP >::ClassId ( ) const
inlineoverridevirtual

Define the class id associated with the class.

This id has to be unique for all classes A non unique id is flagged at the startup of the program

Implements TPZSavable.

Reimplemented in TPZAdmChunkVector< TPZCompEl *>, TPZAdmChunkVector< TPZGeoNode >, TPZAdmChunkVector< TPZGraphNode >, TPZAdmChunkVector< TPZGraphEl *>, TPZAdmChunkVector< TPZConnect >, and TPZAdmChunkVector< TPZGeoEl *>.

Definition at line 259 of file TPZChunkVector.h.

Referenced by TPZAdmChunkVector< TPZGeoEl *>::ClassId().

◆ end() [1/2]

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
iterator TPZChunkVector< T, EXP >::end ( )
inline

Definition at line 220 of file TPZChunkVector.h.

◆ end() [2/2]

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
const_iterator TPZChunkVector< T, EXP >::end ( ) const
inline

Definition at line 224 of file TPZChunkVector.h.

◆ FindObject()

template<class T, int EXP>
int64_t TPZChunkVector< T, EXP >::FindObject ( T *  object)

Finds the index of an object by its pointer.

Definition at line 353 of file TPZChunkVector.h.

Referenced by TPZAdmChunkVectorThreadSafe< T, EXP >::FindObject().

◆ NElements()

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
int64_t TPZChunkVector< T, EXP >::NElements ( ) const
inline

Access method to query the number of elements of the vector.

Returns
Returns the number of elements of the vector.

Definition at line 236 of file TPZChunkVector.h.

Referenced by TPZBuildSBFem::AddPartition(), TPZMulticamadaOrthotropic::AddPlacaOrtho(), TPZCompMesh::AdjustBoundaryElements(), TPZFrontStructMatrix< front >::AdjustSequenceNumbering(), TPZAdmChunkVector< TPZGeoEl *>::AllocateNewElement(), TPZBlockDiagonalStructMatrix::AssembleBlockDiagonal(), AssembleMatrices(), TPZCompMesh::AutoBuildContDisc(), TPZPostProcAnalysis::AutoBuildDisc(), TPZBlockDiagonalStructMatrix::BlockSizes(), TPZBuildMultiphysicsMesh::BuildHybridMesh(), TPZCreateApproximationSpace::BuildMesh(), TPZRefPattern::BuildSideMesh(), TPZCompMesh::BuildTransferMatrixDesc(), TPZSubCompMesh::CalcStiff(), TPZMultiphysicsCompMesh::CleanElementsConnects(), TPZGeoMesh::CleanUp(), TPZCompMesh::CleanUpUnconnectedNodes(), Hdiv2dPaper201504::CMeshMixed(), hdivCurvedJCompAppMath::CMeshMixed(), Hdiv3dPaper201504::CMeshMixed(), TPZAdmChunkVector< TPZGeoEl *>::CompactDataStructure(), TPZCompMesh::CompareMesh(), TPZCompMesh::ComputeFillIn(), TPZGenSubStruct::ComputeInternalEquationPermutation(), TPZDohrStructMatrix::ComputeInternalEquationPermutation(), TPZSubCompMesh::ComputePermutationInternalFirst(), TPZFlowCompMesh::ComputeTimeStep(), TPZAgglomerateElement::CreateAgglomerateMesh(), TPZSubCompMesh::CreateGraphicalElement(), TPZMHMixedMeshControl::CreateHDivMHMMesh(), TPZCreateApproximationSpace::CreateInterfaceElements(), TPZCreateApproximationSpace::CreateInterfaces(), TPZAnalysis::CreateListOfCompElsToComputeError(), TPZAcademicGeoMesh::DeformGMesh(), TCedricTest::DeformGMesh(), TPZCompMesh::DeltaX(), TPZBuildSBFem::DivideSkeleton(), TPZVTKGraphMesh::DrawConnectivity(), TPZMVGraphMesh::DrawConnectivity(), TPZGraphMesh::DrawConnectivity(), TPZVTKGraphMesh::DrawNodes(), TPZMVGraphMesh::DrawNodes(), TPZGraphMesh::DrawNodes(), TPZVTKGraphMesh::DrawSolution(), TPZMVGraphMesh::DrawSolution(), TPZV3DGraphMesh::DrawSolution(), TPZDXGraphMesh::DrawSolution(), TPZGeoEl::ElementExists(), TPZGeoMesh::ElementIndex(), TPZAnalysisError::EvaluateError(), TPZCompMesh::EvaluateError(), TPZExtendGridDimension::ExtendedMesh(), TPZGeoMesh::FindCloseElement(), TPZGraphMesh::FindElement(), TPZGeoMesh::FindElement(), TPZGraphMesh::FindNode(), TPZGeoMesh::FindNode(), TPZRefPattern::FindRefPattern(), TPZRefPattern::GenerateSideRefPatterns(), TPZReadMeshHR::GetNodeIndex(), Height(), TPZDohrStructMatrix::IdentifyCornerNodes(), TPZGenSubStruct::IdentifyEqNumbers(), TPZDohrStructMatrix::IdentifyEqNumbers(), pzgeom::TPZGeoBlend< TGeo >::InsertExampleElement(), TPZRefPattern::InsertPermuted(), TPZCompMesh::LesserEdgeOfMesh(), TPZSubCompMesh::LoadSolution(), TPZParSkylineStructMatrix::main(), TPBSpStructMatrix::main(), TPZFrontStructMatrix< front >::main(), TPZParFrontStructMatrix< front >::main(), TPZSubCompMesh::MakeInternal(), TPZCompMesh::MaximumRadiusOfMesh(), TPZFlowCompMesh::MaxVelocityOfMesh(), TPZMGAnalysis::MeshError(), TPZCompMesh::NConnects(), TPZSubCompMesh::NeedsComputing(), TPZAdmChunkVectorThreadSafe< T, EXP >::NElements(), TPZGraphMesh::NElements(), TPZGeoMesh::NElements(), TPZCompMesh::NElements(), TPZStructMatrixOR::ThreadData::NextElement(), TPZPairStructMatrix::ThreadData::NextElement(), TPZStructMatrixCS::ThreadData::NextElement(), TPZGeoMesh::NNodes(), TPZGeoMesh::NodeIndex(), TPZRefPatternTools::NodesHunter(), TPZGraphMesh::NPoints(), TPZSubCompMesh::NumInternalEquations(), TPZGeoMesh::operator=(), TPZCompMesh::operator=(), TPZChunkVector< TPZGraphNode, 10 >::operator=(), TPZChunkVector< TPZGraphNode, 10 >::operator[](), TPZFrontStructMatrix< front >::OrderElement(), TPZStructMatrixGCTP::OrderElement(), TPZStructMatrixGC::OrderElement(), TPZStructMatrixOT::OrderElement(), TPZSubCompMesh::PermuteExternalConnects(), TPZAnalysis::PostProcess(), TPZAnalysis::PostProcessErrorSerial(), TPZAnalysis::PostProcessTable(), TPZSubCompMesh::PotentialInternal(), TPZGraphMesh::Print(), TPZGeoMesh::Print(), TPZSubCompMesh::Print(), TPZAnalysis::Print(), TPZVTKGeoMesh::PrintGMeshVTK(), TPZGeoMesh::PrintTopologicalInfo(), TPZCompMesh::ProjectSolution(), PYBIND11_MODULE(), TPZGenPartialGrid::Read(), TPZGeoMesh::ReallyNEl(), TPZCompMesh::RemakeAllInterfaceElements(), TPZGenSubStruct::ReorderInternalNodes(), TPZGenSubStruct::ReorderInternalNodes2(), ResequenceByGeometry(), TPZGeoMesh::ResetReference(), TPZGeoMesh::RestoreReference(), TPZCompMesh::SaddlePermute(), TPZMVGraphMesh::SequenceNodes(), TPZV3DGraphMesh::SequenceNodes(), TPZGraphMesh::SequenceNodes(), TPZGraphMesh::SetCompMesh(), TPZStructMatrixBase::SetMaterialIds(), Input::SetPointBC(), SetPointBC(), TPZGenGrid::SetPointBC(), TPZRefPattern::SetRefPatternMeshToMasterDomain(), TPZRefPattern::ShortPrint(), TPZCompMesh::Skyline(), TPZAnalysis::ThreadData::ThreadWork(), TPZChunkVector< TPZGraphNode, 10 >::TPZChunkVector(), TPZCompMesh::TPZCompMesh(), TPZGraphEl::TPZGraphEl(), TPZGraphMesh::TPZGraphMesh(), TPZMGAnalysis::UniformlyRefineMesh(), TPZNonLinMultGridAnalysis::UniformlyRefineMesh(), TPZBuildMultiphysicsMesh::UniformRefineCompEl(), TPZBuildMultiphysicsMesh::UniformRefineCompMesh(), TCedricTest::UnwrapElements(), TPZAdmChunkVector< TPZGeoEl *>::Write(), TPZStream::WritePointers(), and TPZGraphMesh::~TPZGraphMesh().

◆ operator=()

template<class T, int EXP>
TPZChunkVector< T, EXP > & TPZChunkVector< T, EXP >::operator= ( const TPZChunkVector< T, EXP > &  TCh)

Assignment operator, copies all elements from the object TCh.

Parameters
TChChunk vector from which the elements will be copied.

Definition at line 415 of file TPZChunkVector.h.

Referenced by TPZAdmChunkVector< TPZGeoEl *>::operator=().

◆ operator[]()

template<class T , int EXP>
T & TPZChunkVector< T, EXP >::operator[] ( const int64_t  nelem) const
inline

Returns a reference to the ith element of the vector.

If NODEBUG is defined, the element is returned without any bounds checking, else a bounds check is performed and the
code exits if the index is out of bounds. Note that NODEBUG may modify the result of the code.

Definition at line 374 of file TPZChunkVector.h.

Referenced by TPZAdmChunkVectorThreadSafe< T, EXP >::operator[]().

◆ Read()

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
void TPZChunkVector< T, EXP >::Read ( TPZStream buf,
void *  context 
)
inlineoverridevirtual

◆ Resize()

template<class T , int EXP>
void TPZChunkVector< T, EXP >::Resize ( const int64_t  newsize)

Increase the size of the chunk vector.

Parameters
newsizeNew size of the vector. Does not indicate how much memory will be allocated!

Definition at line 315 of file TPZChunkVector.h.

Referenced by TPZStream::ReadPointers(), and TPZAdmChunkVector< TPZGeoEl *>::Resize().

◆ Write()

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
void TPZChunkVector< T, EXP >::Write ( TPZStream buf,
int  withclassid 
) const
inlineoverridevirtual

Writes this object to the TPZStream buffer. Include the classid if withclassid = true.

Writes this object to the TPZStream buffer. Include the classid if withclassid = true

Reimplemented from TPZSavable.

Reimplemented in TPZAdmChunkVector< TPZCompEl *>, TPZAdmChunkVector< TPZGeoNode >, TPZAdmChunkVector< TPZGraphNode >, TPZAdmChunkVector< TPZGraphEl *>, TPZAdmChunkVector< TPZConnect >, and TPZAdmChunkVector< TPZGeoEl *>.

Definition at line 272 of file TPZChunkVector.h.

Member Data Documentation

◆ fNElements

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
int64_t TPZChunkVector< T, EXP >::fNElements
protected

◆ fVec

template<class T, int EXP = DEFAULTCHUNKEXPONENT>
TPZManVector<T*> TPZChunkVector< T, EXP >::fVec
protected

The documentation for this class was generated from the following files: