10 #ifndef stk_mesh_FieldData_hpp 11 #define stk_mesh_FieldData_hpp 15 #include <Shards_Array.hpp> 17 #include <stk_mesh/base/Field.hpp> 18 #include <stk_mesh/base/Bucket.hpp> 19 #include <stk_mesh/base/Entity.hpp> 82 const char * required_by = NULL );
92 const char * required_by = NULL )
113 template<
class field_type >
115 typename FieldTraits< field_type >::data_type *
116 field_data(
const field_type & f ,
const Bucket::iterator i )
123 template<
class field_type >
125 typename FieldTraits< field_type >::data_type *
133 #ifndef DOXYGEN_COMPILE 135 template<
typename ScalarType >
136 struct EntityArray< Field<ScalarType,void,void,void,void,void,void,void> >
137 :
public shards::Array<ScalarType,shards::RankZero,void,void,void,void,void,void,void>
139 typedef Field<ScalarType,void,void,void,void,void,void,void> field_type ;
140 typedef shards::Array<ScalarType,shards::RankZero,void,void,void,void,void,void,void>
143 EntityArray(
const field_type & f ,
const Entity & e )
148 EntityArray(
const EntityArray & );
149 EntityArray & operator = (
const EntityArray & );
156 template<
typename ScalarType ,
157 class Tag1 ,
class Tag2 ,
class Tag3 ,
class Tag4 ,
158 class Tag5 ,
class Tag6 ,
class Tag7 >
160 :
public shards::Array<ScalarType,shards::FortranOrder,Tag1,Tag2,Tag3,Tag4,Tag5,Tag6,Tag7>
162 #ifndef DOXYGEN_COMPILE 164 typedef unsigned char * byte_p ;
173 shards::Array<ScalarType,shards::FortranOrder,Tag1,Tag2,Tag3,Tag4,Tag5,Tag6,Tag7>
180 array_type::assign_stride(
198 const char * name()
const ;
212 template<
typename ScalarType >
215 shards::Array<ScalarType,shards::FortranOrder,EntityDimension,void,void,void,void,void,void>
217 #ifndef DOXYGEN_COMPILE 219 typedef unsigned char * byte_p ;
228 shards::Array<ScalarType,shards::FortranOrder,EntityDimension,void,void,void,void,void,void>
241 const Bucket::iterator i,
242 const Bucket::iterator j)
244 const ptrdiff_t n = j - i ;
246 if ( i->bucket().field_data_size(f) && 0 < n ) {
248 (ScalarType*)( i->bucket().field_data_location( f, *i ) ),
249 (
typename array_type::size_type) n );
260 template<
typename ScalarType ,
261 class Tag1 ,
class Tag2 ,
class Tag3 ,
class Tag4 ,
262 class Tag5 ,
class Tag6 ,
class Tag7 >
264 :
public shards::ArrayAppend<
265 shards::Array<ScalarType,shards::FortranOrder,Tag1,Tag2,Tag3,Tag4,Tag5,Tag6,Tag7> ,
266 EntityDimension >::type
269 #ifndef DOXYGEN_COMPILE 270 typedef unsigned char * byte_p ;
278 typedef typename shards::ArrayAppend<
279 shards::Array<ScalarType,shards::FortranOrder,Tag1,Tag2,Tag3,Tag4,Tag5,Tag6,Tag7> ,
285 array_type::assign_stride(
292 const Bucket::iterator i,
293 const Bucket::iterator j)
295 const ptrdiff_t distance = j - i ;
297 if ( 0 < distance ) {
299 const Bucket & b = i->bucket();
302 array_type::assign_stride(
unsigned bucket_ordinal() const
The ordinal for this entity within its bucket.
Field base class with an anonymous data type and anonymous multi-dimension.
unsigned field_data_size(const FieldBase &field) const
Query the size of this field data specified by FieldBase.
bool field_data_valid(const FieldBase &f, const Entity &e, const char *required_by=NULL)
Check for existence of field data.
Bucket & bucket() const
The bucket which holds this mesh entity's field data.
const FieldBase::Restriction::size_type * field_data_stride(const FieldBase &field) const
Query the stride of this field data specified by FieldBase.
FieldTraits< field_type >::data_type * field_data(const field_type &f, const Entity &e)
Pointer to the field data array.
static const EntityDimension & tag()
Singleton.
Field with defined data type and multi-dimensions (if any)
size_t size() const
Number of entities associated with this bucket.
unsigned char * field_data_location(const FieldBase &field, const Entity &entity) const
Query the location of this field data specified by FieldBase and Entity.
Field data Array for a given array field and entity
A fundamental unit within the discretization of a problem domain, including but not limited to nodes...
unsigned field_data_size(const FieldBase &f, const Entity &e)
Size, in bytes, of the field data for each entity.
Implement ArrayDimTag for the entity count dimension of a BucketArray.
A container for the field data of a homogeneous collection of entities.
FieldTraits< field_type >::data_type * field_data(const field_type &field, const Entity &entity) const
Query the location of this field data specified by FieldBase and Entity.
Field data Array for a given array field and bucket