20 #include "SheafSystem/assert_contract.h" 21 #include "SheafSystem/block_connectivity.h" 22 #include "SheafSystem/std_limits.h" 23 #include "SheafSystem/std_set.h" 81 return _delete_node_ids;
95 return _nodes_per_element;
118 os <<
" " << nids[i+j];
149 _delete_node_ids =
true;
157 ensure(*
this == xother);
158 ensure(node_ids() != xother.
node_ids());
159 ensure(delete_node_ids());
180 result = result && (_node_ct == xother.
_node_ct);
181 result = result && (_node_id_ct == xother.
_node_id_ct);
184 result = result && (_node_ids[i] == xother.
_node_ids[i]);
188 result = result && (_start_id == xother.
_start_id);
211 _delete_node_ids =
false;
213 _nodes_per_element = 0;
218 ensure(element_ct() == 0);
219 ensure(node_ct() == 0);
220 ensure(node_ids() == 0);
221 ensure(!delete_node_ids());
222 ensure(node_id_ct() == 0);
223 ensure(nodes_per_element() == 0);
224 ensure(start_id() == 0);
241 _delete_node_ids =
false;
243 _nodes_per_element = 0;
251 ensure((*
this) == xother);
267 require(xnode_ids != 0);
268 require(xnode_id_ct > 0);
269 require(xnodes_per_element > 0);
273 _element_ct = xnode_id_ct/xnodes_per_element;
281 lstart_id = (lnode_id < lstart_id) ? lnode_id : lstart_id;
287 set<pod_index_type> lnodes;
291 lstart_id = (lnode_id < lstart_id) ? lnode_id : lstart_id;
292 lnodes.insert(lnode_id);
294 _node_ct = lnodes.size();
298 _delete_node_ids =
false;
299 _node_id_ct = xnode_id_ct;
300 _nodes_per_element = xnodes_per_element;
301 _start_id = lstart_id;
305 ensure(element_ct() == xnode_id_ct/xnodes_per_element);
306 ensure(xnode_ct > 0 ? node_ct() == xnode_ct : node_ct() > 0);
307 ensure(node_ids() == xnode_ids);
308 ensure(!delete_node_ids());
309 ensure(node_id_ct() == xnode_id_ct);
310 ensure(nodes_per_element() == xnodes_per_element);
325 _delete_node_ids =
false;
327 _nodes_per_element = 0;
328 _start_id = xstart_id;
332 ensure(node_ids() == 0);
333 ensure(!delete_node_ids());
334 ensure(node_id_ct() == 0);
335 ensure(start_id() == xstart_id);
353 if(invariant_check())
357 disable_invariant_check();
359 invariance(block_relation::invariant());
363 invariance(delete_node_ids() ? node_ids() != 0 :
true);
367 enable_invariant_check();
pod_index_type * _node_ids
The nodal connectivity array.
size_type _nodes_per_element
The number of nodes per element.
virtual bool is_ancestor_of(const any *other) const
Conformance test; true if other conforms to this.
size_type node_id_ct() const
The number of entries in node_ids().
Zone to node connectivity relation for a block of zones of a given type.
pod_index_type * node_ids()
The nodal connectivity array.
Abstract base class with useful features for all objects.
size_type nodes_per_element() const
The number of nodes per element.
size_type _node_id_ct
the number of entyries in _node_ids.
virtual bool invariant() const
Class invariant.
block_connectivity()
Default constructor.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
SHEAF_DLL_SPEC void max(const vd &x0, vd_value_type &xresult, bool xauto_access)
Maximum component of x0, pre-allocated version.
size_type _element_ct
The number of elements.
virtual bool operator==(const block_connectivity &xother) const
Equality operator.
size_type node_ct() const
The number of distinct nodes.
block_connectivity & operator=(const block_connectivity &xother)
Assignment operator.
size_type element_ct() const
The number of elements.
int_type pod_index_type
The plain old data index type.
size_type _node_ct
The number of distinct nodes.
pod_index_type _start_id
The id given to the first node id generated. Mostly only useful for creating 1 (vs 0) based node numb...
pod_index_type start_id() const
The id given to the first node id generated.
virtual ~block_connectivity()
Destructor.
virtual void to_stream(std::ostream &xos) const
Print to stream xos.
Namespace for the fiber_bundles component of the sheaf system.
bool delete_node_ids() const
True if destructor of this should delete _node_ids.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const binary_index &xbi)
Insert binary_index& xbi into ostream& os.