v0.8.15
Public Member Functions | Public Attributes | Friends | List of all members
MoFEM::BlockSetAttributes Struct Reference

Arbitrary block attributes data structure. More...

#include <src/multi_indices/MaterialBlocks.hpp>

Inheritance diagram for MoFEM::BlockSetAttributes:
[legend]
Collaboration diagram for MoFEM::BlockSetAttributes:
[legend]

Public Member Functions

struct __attribute__ ((packed)) _data_
 generic block attributes More...
 
std::size_t getSizeOfData () const
 get data structure size More...
 
const void * getDataPtr () const
 get pointer to data structure More...
 
 BlockSetAttributes ()
 
MoFEMErrorCode fill_data (const std::vector< double > &attributes)
 get data from structure More...
 
MoFEMErrorCode set_data (void *tag_ptr, unsigned int size) const
 set data on structure More...
 
- Public Member Functions inherited from MoFEM::GenericAttributeData
virtual const CubitBCTypegetType () const
 get data type More...
 
virtual unsigned int getMinMumberOfAtributes () const
 get minimal number of attributes which blockset has to have More...
 
 GenericAttributeData (const CubitBCType type, const unsigned int min_number_of_atributes)
 

Public Attributes

_data_ data
 
- Public Attributes inherited from MoFEM::GenericAttributeData
const CubitBCType tYpe
 Type of data (f.e. MAT_ELATIC) More...
 
unsigned int minNumberOfAtributes
 minimal number of attributes More...
 

Friends

std::ostream & operator<< (std::ostream &os, const BlockSetAttributes &e)
 Print data. More...
 

Detailed Description

Arbitrary block attributes data structure.

Definition at line 94 of file MaterialBlocks.hpp.

Constructor & Destructor Documentation

◆ BlockSetAttributes()

MoFEM::BlockSetAttributes::BlockSetAttributes ( )

Definition at line 117 of file MaterialBlocks.hpp.

117  :
119  bzero(&data,sizeof(data));
120  }
GenericAttributeData(const CubitBCType type, const unsigned int min_number_of_atributes)

Member Function Documentation

◆ __attribute__()

struct MoFEM::BlockSetAttributes::__attribute__ ( (packed)  )

generic block attributes

Definition at line 99 of file MaterialBlocks.hpp.

99  {
100  double User1; // User attribute 1
101  double User2; // User attribute 2
102  double User3; // User attribute 3
103  double User4; // User attribute 4
104  double User5; // User attribute 5
105  double User6; // User attribute 6
106  double User7; // User attribute 7
107  double User8; // User attribute 8
108  double User9; // User attribute 9
109  double User10; // User attribute 10
110  };

◆ fill_data()

MoFEMErrorCode MoFEM::BlockSetAttributes::fill_data ( const std::vector< double > &  attributes)
virtual

get data from structure

Parameters
attributesvector of doubles
Returns
error code

Reimplemented from MoFEM::GenericAttributeData.

Definition at line 122 of file MaterialBlocks.hpp.

122  {
124  if(8*attributes.size()>sizeof(data)) {
125  SETERRQ(
126  PETSC_COMM_SELF,
128  "data inconsistency, please review the number of material properties defined"
129  );
130  }
131  bzero(&data,sizeof(data));
132  memcpy(&data, &attributes[0],8*attributes.size());
134  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

◆ getDataPtr()

const void* MoFEM::BlockSetAttributes::getDataPtr ( ) const
virtual

get pointer to data structure

Returns
pointer

Implements MoFEM::GenericAttributeData.

Definition at line 115 of file MaterialBlocks.hpp.

115 { return &data; }

◆ getSizeOfData()

std::size_t MoFEM::BlockSetAttributes::getSizeOfData ( ) const
virtual

get data structure size

Returns
size of structure in bytes

Implements MoFEM::GenericAttributeData.

Definition at line 114 of file MaterialBlocks.hpp.

114 { return sizeof(_data_); }

◆ set_data()

MoFEMErrorCode MoFEM::BlockSetAttributes::set_data ( void *  tag_ptr,
unsigned int  size 
) const
virtual

set data on structure

Parameters
tag_ptrpointer to tag on meshset
sizesize of data in bytes
Returns
error code

Reimplemented from MoFEM::GenericAttributeData.

Definition at line 135 of file MaterialBlocks.hpp.

135  {
137  if(size>sizeof(data)) {
138  SETERRQ(
139  PETSC_COMM_SELF,
141  "data inconsistency, please review the number of material properties defined"
142  );
143  }
144  memcpy(tag_ptr,&data,size);
146  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:483
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:490

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const BlockSetAttributes e 
)
friend

Print data.

Definition at line 552 of file BCMultiIndices.cpp.

553  {
554  os << std::endl << "Blcok attributes" << std::endl;
555  os << "-------------------" << std::endl;
556  os << "User attribute 1 = " << e.data.User1 << std::endl;
557  os << "User attribute 2 = " << e.data.User2 << std::endl;
558  os << "User attribute 3 = " << e.data.User3 << std::endl;
559  os << "User attribute 4 = " << e.data.User4 << std::endl;
560  os << "User attribute 5 = " << e.data.User5 << std::endl;
561  os << "User attribute 6 = " << e.data.User6 << std::endl;
562  os << "User attribute 7 = " << e.data.User7 << std::endl;
563  os << "User attribute 8 = " << e.data.User7 << std::endl;
564  os << "User attribute 9 = " << e.data.User7 << std::endl;
565  os << "User attribute 10 = " << e.data.User10 << std::endl << std::endl;
566  return os;
567  }

Member Data Documentation

◆ data

_data_ MoFEM::BlockSetAttributes::data

Definition at line 110 of file MaterialBlocks.hpp.


The documentation for this struct was generated from the following file: