SheafSystem  0.0.0.0
sheaf::subposet_state Class Reference

The data structure representing the state of a subposet. More...

#include <subposet_state.h>

SUBPOSET_STATE FACET

zn_to_bool_members
 Characteristic function defining members of this subposet. More...
 
scoped_index _index
 Index of this subposet in powerset::_member_pool also used for next(). More...
 
bool _is_dof_subposet
 True if this is a dofs subposet. More...
 
size_type _dof_ct
 The number of dofs associated with this Only defined if this is a dofs subposet, in which case _dof_ct == _members.ct() but is more fficient to evaluate. More...
 
dof_descriptor_array_dof_descriptors
 If this is a dofs subposet, the offset of each dof when the dofs are contiguously allocated. More...
 
scattered_insertion_index_space_handle_id_space
 The id space for this subposet state. More...
 
bool _is_persistent
 True if and only if this subposet should be written to disk. More...
 
 subposet_state ()
 Default constructor. More...
 
 ~subposet_state ()
 Destructor. More...
 
void initialize (int xmember_ub, const scoped_index &xindex, bool xinitialize)
 Initialize data members. More...
 
void initialize (int xmember_ub, const scoped_index &xindex, const block< pod_index_type > &xmembers)
 Initialize data members to xmembers. More...
 
void initialize (int xmember_ub, const scoped_index &xindex, const block< scoped_index > &xmembers)
 Initialize data members to xmembers. More...
 
bool is_initialized () const
 True, if this is initialized. More...
 
void terminate ()
 Set all data members to NULL. More...
 
bool is_terminated () const
 True, if this is teminated. More...
 
const scoped_indexnext () const
 Get the next member in free list. More...
 
void put_next (const scoped_index &xnext)
 Put the next member in free list. More...
 
zn_to_boolmembers () const
 Get the members of the subposet. More...
 
void put_members (const zn_to_bool *xmembers)
 Put members of the subposet. More...
 
const scoped_indexindex () const
 Get index of the subposet. More...
 
bool is_dof_subposet () const
 True, if this is a dofs subposet. More...
 
void put_is_dof_subposet (bool xis_dof_subposet)
 True, if this is a dofs subposet. More...
 
size_type dof_ct () const
 Get the number of dofs
Only defined if this is a dofs subposet, in which case _dof_ct == _members.ct() but is more fficient to evaluate. More...
 
void put_dof_ct (size_type xdof_ct)
 Put the number of dofs
Only defined if this is a dofs subposet, in which case _dof_ct == _members.ct() but is more fficient to evaluate. More...
 
size_type dof_tuple_ub ()
 Get the upper bound of the dof tuple
Only defined if this is a dofs subposet. More...
 
dof_descriptor_arraydof_descriptors () const
 Get the offset of each dof when the dofs are contiguously allocated.
Only defined if this is a dofs subposet. More...
 
void put_dof_descriptors (const dof_descriptor_array *xdof_descriptors)
 Put the offset of each dof when the dofs are contiguously allocated.
Only defined if this is a dofs subposet. More...
 
bool has_id_space () const
 True if this has an id space. More...
 
const scattered_insertion_index_space_handleid_space () const
 The id space for this subposet state (const version). More...
 
scattered_insertion_index_space_handleid_space ()
 The id space for this subposet state (mutable version). More...
 
void put_id_space (const index_space_family &xid_spaces, pod_index_type xid)
 Put the id space for this subposet state. More...
 
void put_id_space (const index_space_family &xid_spaces, const std::string &xname)
 Put the id space for this subposet state. More...
 
bool is_persistent () const
 True if this id space should be written to disk. More...
 
void put_is_persistent (bool xvalue)
 Sets is_persistent() to xvalue. More...
 

Detailed Description

The data structure representing the state of a subposet.

Definition at line 65 of file subposet_state.h.

Constructor & Destructor Documentation

◆ subposet_state()

sheaf::subposet_state::subposet_state ( )

Default constructor.

Postcondition
  • !has_id_space()

Definition at line 35 of file subposet_state.cc.

References ~subposet_state().

◆ ~subposet_state()

sheaf::subposet_state::~subposet_state ( )

Destructor.

Postcondition

Definition at line 57 of file subposet_state.cc.

References initialize().

Referenced by subposet_state().

Member Function Documentation

◆ dof_ct()

sheaf::size_type sheaf::subposet_state::dof_ct ( ) const

Get the number of dofs
Only defined if this is a dofs subposet, in which case _dof_ct == _members.ct() but is more fficient to evaluate.

Definition at line 376 of file subposet_state.cc.

References put_dof_ct().

Referenced by sheaf::operator<<(), and put_is_dof_subposet().

◆ dof_descriptors()

sheaf::dof_descriptor_array * sheaf::subposet_state::dof_descriptors ( ) const

Get the offset of each dof when the dofs are contiguously allocated.
Only defined if this is a dofs subposet.

Definition at line 415 of file subposet_state.cc.

References put_dof_descriptors().

Referenced by dof_tuple_ub(), and sheaf::operator<<().

◆ dof_tuple_ub()

sheaf::size_type sheaf::subposet_state::dof_tuple_ub ( )

Get the upper bound of the dof tuple
Only defined if this is a dofs subposet.

Precondition

Definition at line 402 of file subposet_state.cc.

References dof_descriptors().

Referenced by put_dof_ct().

◆ has_id_space()

bool sheaf::subposet_state::has_id_space ( ) const

True if this has an id space.

Definition at line 442 of file subposet_state.cc.

References id_space().

Referenced by put_dof_descriptors().

◆ id_space() [1/2]

const sheaf::scattered_insertion_index_space_handle & sheaf::subposet_state::id_space ( ) const

The id space for this subposet state (const version).

Precondition

Definition at line 449 of file subposet_state.cc.

Referenced by has_id_space().

◆ id_space() [2/2]

sheaf::scattered_insertion_index_space_handle & sheaf::subposet_state::id_space ( )

The id space for this subposet state (mutable version).

Precondition

Definition at line 462 of file subposet_state.cc.

References put_id_space().

◆ index()

const sheaf::scoped_index & sheaf::subposet_state::index ( ) const

Get index of the subposet.

Definition at line 343 of file subposet_state.cc.

References is_dof_subposet().

Referenced by put_members().

◆ initialize() [1/3]

void sheaf::subposet_state::initialize ( int  xmember_ub,
const scoped_index xindex,
bool  xinitialize 
)

Initialize data members.

Precondition
  • xmember_ub >= 0
  • xindex.is_valid()
  • -unexecutable( "for all i in xmembers: 0 <= i < xmember_ub" )
Postcondition
  • _members->ub() >= xmember_ub
  • _index == xindex

Definition at line 74 of file subposet_state.cc.

References sheaf::scoped_index::is_valid().

Referenced by initialize(), and ~subposet_state().

◆ initialize() [2/3]

void sheaf::subposet_state::initialize ( int  xmember_ub,
const scoped_index xindex,
const block< pod_index_type > &  xmembers 
)

Initialize data members to xmembers.

Precondition
  • xmember_ub >= 0
  • xindex.is_valid()
  • -unexecutable( "for all i in xmembers: 0 <= i < xmember_ub" )
Postcondition
  • _members->ub() >= xmember_ub
  • _index == xindex

Definition at line 116 of file subposet_state.cc.

References sheaf::auto_block< T, S >::ct(), initialize(), and sheaf::scoped_index::is_valid().

◆ initialize() [3/3]

void sheaf::subposet_state::initialize ( int  xmember_ub,
const scoped_index xindex,
const block< scoped_index > &  xmembers 
)

Initialize data members to xmembers.

Precondition
  • xmember_ub >= 0
  • xindex.is_valid()
  • -unexecutable( "for all i in xmembers: 0 <= i < xmember_ub" )
Postcondition
  • _members->ub() >= xmember_ub
  • _index == xindex

Definition at line 157 of file subposet_state.cc.

References sheaf::auto_block< T, S >::ct(), is_initialized(), and sheaf::scoped_index::is_valid().

◆ is_dof_subposet()

bool sheaf::subposet_state::is_dof_subposet ( ) const

True, if this is a dofs subposet.

Definition at line 350 of file subposet_state.cc.

References put_is_dof_subposet().

Referenced by index(), and sheaf::operator<<().

◆ is_initialized()

bool sheaf::subposet_state::is_initialized ( ) const

True, if this is initialized.

Postcondition
  • _members != 0
  • _index.is_valid()

Definition at line 198 of file subposet_state.cc.

References terminate().

Referenced by initialize().

◆ is_persistent()

bool sheaf::subposet_state::is_persistent ( ) const

True if this id space should be written to disk.

Definition at line 537 of file subposet_state.cc.

References put_is_persistent().

Referenced by put_id_space().

◆ is_terminated()

bool sheaf::subposet_state::is_terminated ( ) const

True, if this is teminated.

Postcondition
  • result ? !is_dof_subposet() : true
  • result ? !has_id_space() : true

Definition at line 260 of file subposet_state.cc.

References sheaf::is_valid(), and next().

Referenced by terminate().

◆ members()

sheaf::zn_to_bool * sheaf::subposet_state::members ( ) const

◆ next()

const sheaf::scoped_index & sheaf::subposet_state::next ( ) const

Get the next member in free list.

Definition at line 291 of file subposet_state.cc.

References put_next().

Referenced by is_terminated().

◆ put_dof_ct()

void sheaf::subposet_state::put_dof_ct ( size_type  xdof_ct)

Put the number of dofs
Only defined if this is a dofs subposet, in which case _dof_ct == _members.ct() but is more fficient to evaluate.

Postcondition

Definition at line 383 of file subposet_state.cc.

References dof_tuple_ub().

Referenced by dof_ct().

◆ put_dof_descriptors()

void sheaf::subposet_state::put_dof_descriptors ( const dof_descriptor_array xdof_descriptors)

Put the offset of each dof when the dofs are contiguously allocated.
Only defined if this is a dofs subposet.

Postcondition

Definition at line 422 of file subposet_state.cc.

References sheaf::dof_descriptor_array::add_reference(), and has_id_space().

Referenced by dof_descriptors().

◆ put_id_space() [1/2]

void sheaf::subposet_state::put_id_space ( const index_space_family xid_spaces,
pod_index_type  xid 
)

Put the id space for this subposet state.

Precondition
  • xid_spaces.contains(xid)
  • xid_spaces.handle_conforms_to_state<scattered_insertion_index_space_handle>(xid)
Postcondition

Definition at line 475 of file subposet_state.cc.

References sheaf::index_space_family::contains(), sheaf::index_space_family::get_id_space(), and sheaf::index_space_family::handle_conforms_to_state().

Referenced by id_space().

◆ put_id_space() [2/2]

void sheaf::subposet_state::put_id_space ( const index_space_family xid_spaces,
const std::string &  xname 
)

Put the id space for this subposet state.

Precondition
  • xid_spaces.contains(xname)
  • xid_spaces.handle_conforms_to_state<scattered_insertion_index_space_handle>(xname)
Postcondition

Definition at line 506 of file subposet_state.cc.

References sheaf::index_space_family::contains(), sheaf::index_space_family::get_id_space(), sheaf::index_space_family::handle_conforms_to_state(), and is_persistent().

◆ put_is_dof_subposet()

void sheaf::subposet_state::put_is_dof_subposet ( bool  xis_dof_subposet)

True, if this is a dofs subposet.

Postcondition

Definition at line 357 of file subposet_state.cc.

References dof_ct().

Referenced by is_dof_subposet().

◆ put_is_persistent()

void sheaf::subposet_state::put_is_persistent ( bool  xvalue)

Sets is_persistent() to xvalue.

Postcondition

Definition at line 544 of file subposet_state.cc.

References sheaf::operator<<().

Referenced by is_persistent().

◆ put_members()

void sheaf::subposet_state::put_members ( const zn_to_bool xmembers)

Put members of the subposet.

Postcondition

Definition at line 324 of file subposet_state.cc.

References index().

Referenced by members().

◆ put_next()

void sheaf::subposet_state::put_next ( const scoped_index xnext)

Put the next member in free list.

Definition at line 300 of file subposet_state.cc.

References members().

Referenced by next().

◆ terminate()

void sheaf::subposet_state::terminate ( )

Set all data members to NULL.

Postcondition

Definition at line 221 of file subposet_state.cc.

References is_terminated().

Referenced by is_initialized().

Member Data Documentation

◆ _dof_ct

size_type sheaf::subposet_state::_dof_ct
protected

The number of dofs associated with this Only defined if this is a dofs subposet, in which case _dof_ct == _members.ct() but is more fficient to evaluate.

Definition at line 245 of file subposet_state.h.

◆ _dof_descriptors

dof_descriptor_array* sheaf::subposet_state::_dof_descriptors
protected

If this is a dofs subposet, the offset of each dof when the dofs are contiguously allocated.

Definition at line 251 of file subposet_state.h.

◆ _id_space

scattered_insertion_index_space_handle* sheaf::subposet_state::_id_space
protected

The id space for this subposet state.

Definition at line 256 of file subposet_state.h.

◆ _index

scoped_index sheaf::subposet_state::_index
protected

Index of this subposet in powerset::_member_pool also used for next().

Definition at line 233 of file subposet_state.h.

◆ _is_dof_subposet

bool sheaf::subposet_state::_is_dof_subposet
protected

True if this is a dofs subposet.

Definition at line 238 of file subposet_state.h.

◆ _is_persistent

bool sheaf::subposet_state::_is_persistent
protected

True if and only if this subposet should be written to disk.

Definition at line 261 of file subposet_state.h.

◆ _members

zn_to_bool* sheaf::subposet_state::_members
protected

Characteristic function defining members of this subposet.

Definition at line 227 of file subposet_state.h.


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