xc
MaterialVector.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // under the terms of the GNU General Public License published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 //MaterialVector.h
29 
30 #ifndef MaterialVector_h
31 #define MaterialVector_h
32 
33 #include <vector>
34 #include "utility/kernel/CommandEntity.h"
35 #include "material/ResponseId.h"
36 #include "utility/actor/actor/MovableID.h"
37 #include "utility/matrix/Vector.h"
38 #include "utility/matrix/Matrix.h"
39 #include "utility/utils/misc_utils/colormod.h"
40 
41 
42 namespace XC {
43 
45 //
48 template <class MAT>
49 class MaterialVector: public std::vector<MAT *>, public CommandEntity, public MovableObject
50  {
51  protected:
52  void clearAll(void);
53  static MAT *get_material_copy(const MAT *, const std::string &type);
54  static MAT *get_material_copy(const MAT *);
55  void alloc(const std::vector<MAT *> &mats);
56 
57 
58  DbTagData &getDbTagData(void) const;
59  int sendData(Communicator &);
60  int recvData(const Communicator &);
61  public:
62  typedef typename std::vector<MAT *> mat_vector;
63  typedef typename mat_vector::iterator iterator;
64  typedef typename mat_vector::const_iterator const_iterator;
65  typedef typename mat_vector::reference reference;
66  typedef typename mat_vector::const_reference const_reference;
67 
68  MaterialVector(const size_t &nMat,const MAT *matModel= nullptr);
71  ~MaterialVector(void)
72  { clearAll(); }
73 
74  void clearMaterials(void);
75  void setMaterial(const MAT *);
76  void setMaterial(size_t i, const MAT *);
77  void setMaterial(size_t i, const MAT &);
78  void setMaterial(const MAT *,const std::string &);
79  void copyPropsFrom(const EntityWithProperties *);
80 
81  bool empty(void) const;
82  int commitState(void);
83  int revertToLastCommit(void);
84  int revertToStart(void);
85 
86  void setInitialGeneralizedStrains(const std::vector<Vector> &);
87  void incrementInitialGeneralizedStrains(const std::vector<Vector> &);
89 
90  size_t getGeneralizedStressSize(void) const;
91  size_t getGeneralizedStrainSize(void) const;
92  Matrix getGeneralizedStresses(void) const;
93  Matrix getGeneralizedStrains(void) const;
94  const Vector &getMeanGeneralizedStress(void) const;
95  const Vector &getMeanGeneralizedStrain(void) const;
96  double getMeanGeneralizedStrain(const int &defID) const;
97  double getMeanGeneralizedStress(const int &defID) const;
98  double getMeanGeneralizedStrain(const std::string &cod) const;
99  double getMeanGeneralizedStress(const std::string &cod) const;
100 
101  std::deque<int> getComponentIndexesFromCode(const std::string &code) const;
102 
103  Vector getGeneralizedStrainAtGaussPoints(const int &) const;
104  Vector getGeneralizedStressAtGaussPoints(const int &) const;
105 
106  Matrix getGeneralizedStrain(const int &defID) const;
107  Matrix getGeneralizedStress(const int &defID) const;
108 
109  Matrix getValues(const std::string &, bool silent= false) const;
110 
111  std::set<std::string> getNames(void) const;
112  boost::python::list getNamesPy(void) const;
113  std::set<int> getTags(void) const;
114  boost::python::list getTagsPy(void) const;
115 
116  int sendSelf(Communicator &);
117  int recvSelf(const Communicator &);
118  };
119 
121 template <class MAT>
122 MaterialVector<MAT>::MaterialVector(const size_t &nMat,const MAT *matModel)
123  : std::vector<MAT *>(nMat,nullptr), MovableObject(MAT_VECTOR_TAG)
124  {
125  if(matModel)
126  {
127  for(iterator i= mat_vector::begin();i!=mat_vector::end();i++)
128  {
129  MAT *tmp= MaterialVector<MAT>::get_material_copy(matModel);
130  if(tmp)
131  { (*i)= tmp; }
132  }
133  }
134  }
135 
137 template <class MAT>
138 void MaterialVector<MAT>::alloc(const std::vector<MAT *> &mats)
139  {
140  clearAll();
141  const size_t nMat= mats.size();
142  this->resize(nMat);
143  for(size_t i= 0;i<nMat;i++)
144  {
145  if(mats[i])
146  {
147  MAT *tmp= MaterialVector<MAT>::get_material_copy(mats[i]);
148  if(tmp)
149  { (*this)[i]= tmp; }
150  }
151  }
152  }
153 
155 template <class MAT>
157  : std::vector<MAT *>(other.size(),nullptr), MovableObject(MAT_VECTOR_TAG)
158  { alloc(other); }
159 
161 template <class MAT>
163  {
164  alloc(other);
165  return *this;
166  }
167 
168 template <class MAT>
169 MAT *MaterialVector<MAT>::get_material_copy(const MAT *new_mat)
170  {
171  MAT *retval= nullptr;
172  if(new_mat)
173  {
174  Material *copy_ptr= new_mat->getCopy();
175  if(copy_ptr)
176  {
177  retval= dynamic_cast<MAT *>(copy_ptr);
178  if(!retval)
179  {
180  std::cerr << Color::red << "MaterialVector::" << __FUNCTION__
181  << "; the type of the given material: "
182  << new_mat->getClassName()
183  << " cannot be converted to a "
184  << typeid(MAT).name()
185  << " material."
186  << Color::def << std::endl;
187  delete copy_ptr;
188  copy_ptr= nullptr;
189  }
190  }
191  else
192  std::cerr << Color::red << "MaterialVector::" << __FUNCTION__
193  << "; failed allocate material model pointer."
194  << Color::def << std::endl;
195  }
196  return retval;
197  }
198 
199 template <class MAT>
200 MAT *MaterialVector<MAT>::get_material_copy(const MAT *new_mat, const std::string &type)
201  {
202  MAT *retval= nullptr;
203  if(new_mat)
204  {
205  Material *copy_ptr= new_mat->getCopy(type.c_str());
206  if(copy_ptr)
207  {
208  retval= dynamic_cast<MAT *>(copy_ptr);
209  if(!retval)
210  {
211  std::cerr << Color::red << "MaterialVector::" << __FUNCTION__
212  << "; the type of the given material: "
213  << new_mat->getClassName()
214  << " cannot be converted to a "
215  << typeid(MAT).name()
216  << " material."
217  << Color::def << std::endl;
218  delete copy_ptr;
219  copy_ptr= nullptr;
220  }
221  }
222  else
223  std::cerr << Color::red << "MaterialVector::" << __FUNCTION__
224  << "; failed allocate material model pointer."
225  << Color::def << std::endl;
226  }
227  return retval;
228  }
229 
230 template <class MAT>
231 void MaterialVector<MAT>::setMaterial(const MAT *new_mat)
232  {
233  clearMaterials();
234  if(new_mat)
235  {
236  for(iterator i= mat_vector::begin();i!=mat_vector::end();i++)
237  {
238  MAT *tmp= MaterialVector<MAT>::get_material_copy(new_mat);
239  if(tmp)
240  { (*i)= tmp; }
241  }
242  }
243  }
244 
245 template <class MAT>
246 void MaterialVector<MAT>::setMaterial(const MAT *new_mat, const std::string &type)
247  {
248  clearMaterials();
249  if(new_mat)
250  {
251  for(iterator i= mat_vector::begin();i!=mat_vector::end();i++)
252  {
253  MAT *tmp= MaterialVector<MAT>::get_material_copy(new_mat, type);
254  if(tmp)
255  { (*i)= tmp; }
256  }
257  }
258  }
259 
260 template <class MAT>
261 void MaterialVector<MAT>::setMaterial(size_t i, const MAT *new_mat)
262  {
263  if((*this)[i])
264  delete (*this)[i];
265  MAT *tmp= MaterialVector<MAT>::get_material_copy(new_mat);
266  (*this)[i]= tmp;
267  }
268 
269 template <class MAT>
270 void MaterialVector<MAT>::setMaterial(size_t i, const MAT &new_mat)
271  { setMaterial(i, &new_mat); }
272 
275 template <class MAT>
277  {
278  if(other_mat)
279  {
280  const EntityWithProperties &tmp= *other_mat;
281  for(iterator i= mat_vector::begin();i!=mat_vector::end();i++)
282  {
283  (*i)->copyPropsFrom(tmp);
284  }
285  }
286  }
287 
288 template <class MAT>
290  {
291  for(iterator i= mat_vector::begin();i!=mat_vector::end();i++)
292  {
293  if(*i)
294  {
295  delete (*i);
296  (*i)= nullptr;
297  }
298  }
299  }
300 
302 template <class MAT>
304  {
305  if(mat_vector::empty())
306  return true;
307  else
308  return ((*this)[0]==nullptr);
309  }
310 
311 template <class MAT>
313  {
314  clearMaterials();
315  std::vector<MAT *>::clear();
316  }
317 
318 
320 template <class MAT>
322  {
323  int retVal= 0;
324 
325  for(iterator i=mat_vector::begin();i!=mat_vector::end();i++)
326  retVal+= (*i)->commitState();
327  return retVal;
328  }
329 
331 template <class MAT>
333  {
334  int retVal= 0;
335 
336  for(iterator i=mat_vector::begin();i!=mat_vector::end();i++)
337  retVal+= (*i)->revertToLastCommit() ;
338  return retVal;
339  }
340 
341 
343 template <class MAT>
345  {
346  int retVal = 0;
347 
348  for(iterator i=mat_vector::begin();i!=mat_vector::end();i++)
349  retVal+= (*i)->revertToStart();
350  return retVal;
351  }
352 
357 template <class MAT>
358 XC::Matrix XC::MaterialVector<MAT>::getValues(const std::string &code, bool silent) const
359  {
360  Matrix retval;
361  const int nMat= this->size();
362  std::vector<Matrix> tmp(nMat);
363  int count= 0;
364  int nRows= 0;
365  int nCols= 0;
366  for(const_iterator i=mat_vector::begin();i!=mat_vector::end();i++, count++)
367  {
368  const Matrix v= (*i)->getValues(code, silent);
369  nRows+= v.noRows();
370  nCols= std::max(nCols, v.noCols());
371  tmp[count]= v;
372  }
373  retval.resize(nRows,nCols);
374  int iRow= 0;
375  int iCol= 0;
376  for(int i= 0;i<nMat;i++)
377  {
378  const Matrix v= tmp[i];
379  for(int j= 0;j<v.noRows();j++)
380  {
381  for(int k= 0;k<v.noCols();k++)
382  {
383  iCol= k;
384  retval(iRow,iCol)= v(j,k);
385  }
386  iRow+= 1;
387  }
388  }
389  return retval;
390  }
391 
393 template <class MAT>
395  { return (*this)[0]->getGeneralizedStress().Size(); }
396 
398 template <class MAT>
400  { return (*this)[0]->getGeneralizedStrain().Size(); }
401 
403 template <class MAT>
405  {
406  const size_t ncol= getGeneralizedStressSize();
407  const size_t nMat= this->size();
408  Matrix retval(nMat,ncol);
409  for(size_t i= 0;i<nMat;i++)
410  {
411  const Vector &s= (*this)[i]->getGeneralizedStress();
412  retval.putRow(i,s);
413  }
414  return retval;
415  }
416 
418 template <class MAT>
420  {
421  const size_t ncol= getGeneralizedStrainSize();
422  const size_t nMat= this->size();
423  Matrix retval(nMat,ncol);
424  for(size_t i= 0;i<nMat;i++)
425  {
426  const Vector &s= (*this)[i]->getGeneralizedStrain();
427  for(size_t j= 0;j<ncol;j++)
428  retval(i,j)= s(j);
429  }
430  return retval;
431  }
432 
434 template <class MAT>
436  {
437  static Vector retval;
438  retval= (*this)[0]->getGeneralizedStress();
439  const size_t nMat= this->size();
440  for(size_t i= 1;i<nMat;i++)
441  retval+= (*this)[i]->getGeneralizedStress();
442  retval/=nMat;
443  return retval;
444  }
445 
447 template <class MAT>
449  {
450  static Vector retval;
451  retval= (*this)[0]->getGeneralizedStrain();
452  const size_t nMat= this->size();
453  for(size_t i= 0;i<nMat;i++)
454  retval+= (*this)[i]->getGeneralizedStrain();
455  retval/=nMat;
456  return retval;
457  }
458 
461 template <class MAT>
462 std::deque<int> MaterialVector<MAT>::getComponentIndexesFromCode(const std::string &code) const
463  {
464  const ResponseId &rId= (*this)[0]->getResponseType();
465  return rId.getComponentIndexesFromCode(code);
466  }
467 
470 template <class MAT>
471 double MaterialVector<MAT>::getMeanGeneralizedStrain(const int &defID) const
472  {
473  double retval= 0.0;
474  const Vector &e= getMeanGeneralizedStrain(); //generalized strains vector.
475  const ResponseId &code= (*this)[0]->getResponseType();
476  const int order= code.Size();
477  for(int i= 0;i<order;i++)
478  if(code(i) == defID)
479  retval+= e(i);
480  return retval;
481  }
482 
485 template <class MAT>
486 double MaterialVector<MAT>::getMeanGeneralizedStrain(const std::string &cod) const
487  {
488  const ResponseId &rId= (*this)[0]->getResponseType();
489  const int defId= rId.getComponentIdFromString(cod);
490  return this->getMeanGeneralizedStrain(defId);
491  }
492 
495 template <class MAT>
497  {
498  const size_t nMat= this->size();
499  const ResponseId &code= (*this)[0]->getResponseType();
500  const int order= code.Size();
501  Vector retval(nMat);
502  for(size_t i= 0;i<nMat;i++)
503  {
504  const Vector &e= (*this)[i]->getGeneralizedStrain(); //Strain at i-th Gauss point.
505  for(int j= 0;j<order;j++) // Searching for the component.
506  if(code(j) == defID)
507  retval(i)= e(j);
508  }
509  return retval;
510  }
511 
512 
515 template <class MAT>
516 double MaterialVector<MAT>::getMeanGeneralizedStress(const int &defID) const
517  {
518  double retval= 0.0;
519  const Vector &f= getMeanGeneralizedStress(); //Vector de esfuerzos.
520  const ResponseId &code= (*this)[0]->getResponseType();
521  const int order= code.Size();
522  for(int i= 0;i<order;i++)
523  if(code(i) == defID)
524  retval+= f(i);
525  return retval;
526  }
527 
530 template <class MAT>
531 double MaterialVector<MAT>::getMeanGeneralizedStress(const std::string &cod) const
532  {
533  const ResponseId &rId= (*this)[0]->getResponseType();
534  const int defId= rId.getComponentIdFromString(cod);
535  return this->getMeanGeneralizedStress(defId);
536  }
537 
540 template <class MAT>
542  {
543  const size_t nMat= this->size();
544  const ResponseId &code= (*this)[0]->getResponseType();
545  const int order= code.Size();
546  Vector retval(nMat);
547  for(size_t i= 0;i<nMat;i++)
548  {
549  const Vector &e= (*this)[i]->getGeneralizedStress(); //Stress at i-th Gauss point.
550  for(int j= 0;j<order;j++) // Searching for the component.
551  if(code(j) == defID)
552  retval(i)= e(j);
553  }
554  return retval;
555  }
556 
559 template <class MAT>
561  {
562  const size_t nMat= this->size();
563  Matrix retval(nMat,1);
564  const ResponseId &code= (*this)[0]->getResponseType();
565  const int order= code.Size();
566  for(size_t i= 0;i<nMat;i++)
567  {
568  const Vector &s= (*this)[i]->getGeneralizedStress();
569  for(int j= 0;j<order;j++)
570  if(code(j) == defID)
571  retval(i,1)+= s(i);
572  }
573  return retval;
574  }
575 
578 template <class MAT>
580  {
581  const size_t nMat= this->size();
582  Matrix retval(nMat,1);
583  const ResponseId &code= (*this)[0]->getResponseType();
584  const int order= code.Size();
585  for(size_t i= 0;i<nMat;i++)
586  {
587  const Vector &s= (*this)[i]->getGeneralizedStrain();
588  for(int j= 0;j<order;j++)
589  if(code(j) == defID)
590  retval(i,1)+= s(i);
591  }
592  return retval;
593  }
594 
596 template <class MAT>
597 void MaterialVector<MAT>::setInitialGeneralizedStrains(const std::vector<Vector> &iS)
598  {
599  const size_t nMat= this->size();
600  const size_t sz= std::min(nMat,iS.size());
601  if(iS.size()<nMat)
602  std::cerr << Color::red << getClassName() << "::" << __FUNCTION__
603  << "; received: "
604  << iS.size() << " generalized strain vectors, expected: "
605  << nMat << "."
606  << Color::def << std::endl;
607  for(size_t i= 0;i<sz;i++)
608  (*this)[i]->setInitialGeneralizedStrain(iS[i]);
609  }
610 
612 template <class MAT>
614  {
615  const size_t nMat= this->size();
616  const size_t sz= std::min(nMat,iS.size());
617  if(iS.size()<nMat)
618  std::cerr << Color::red << getClassName() << "::" << __FUNCTION__
619  << "; received: "
620  << iS.size() << " generalized strain vectors, expected: "
621  << nMat << "."
622  << Color::def << std::endl;
623  for(size_t i= 0;i<sz;i++)
624  (*this)[i]->incrementInitialGeneralizedStrain(iS[i]);
625  }
626 
628 template <class MAT>
630  {
631  const size_t nMat= this->size();
632  for(size_t i= 0;i<nMat;i++)
633  (*this)[i]->zeroInitialGeneralizedStrain();
634  }
635 
638 template <class MAT>
640  {
641  static DbTagData retval(2);
642  return retval;
643  }
644 
646 template <class MAT>
648  {
649  int res= 0;
650  if(this->empty())
651  setDbTagDataPos(0,0);
652  else
653  {
654  setDbTagDataPos(0,1);
655  const size_t nMat= this->size();
656  DbTagData cpMat(nMat*3);
657 
658  for(size_t i= 0;i<nMat;i++)
659  res+= comm.sendBrokedPtr((*this)[i],cpMat,BrokedPtrCommMetaData(i,i+nMat,i+2*nMat));
660  res+= cpMat.send(getDbTagData(),comm,CommMetaData(1));
661  }
662  return res;
663  }
664 
666 template <class MAT>
668  {
669  const int flag= getDbTagDataPos(0);
670  int res= 0;
671  if(flag!=0)
672  {
673  const size_t nMat= this->size();
674  DbTagData cpMat(nMat*3);
675  res+= cpMat.receive(getDbTagData(),comm,CommMetaData(1));
676  clearMaterials(); // erase existing materials if any.
677  for(size_t i= 0;i<nMat;i++)
678  {
679  const BrokedPtrCommMetaData meta(i,i+nMat,i+2*nMat);
680  // Receive the material
681  (*this)[i]= comm.getBrokedMaterial((*this)[i],cpMat,meta);
682  }
683  }
684  return res;
685  }
686 
688 template <class MAT>
689 std::set<std::string> MaterialVector<MAT>::getNames(void) const
690  {
691  std::set<std::string> retval;
692  for(const_iterator i= mat_vector::begin();i!=mat_vector::end();i++)
693  retval.insert((*i)->getName());
694  return retval;
695  }
696 
698 template <class MAT>
699 boost::python::list MaterialVector<MAT>::getNamesPy(void) const
700  {
701  boost::python::list retval;
702  std::set<std::string> tmp= getNames();
703  for(std::set<std::string>::const_iterator i= tmp.begin();i!=tmp.end();i++)
704  retval.append(*i);
705  return retval;
706  }
707 
709 template <class MAT>
710 std::set<int> MaterialVector<MAT>::getTags(void) const
711  {
712  std::set<int> retval;
713  for(const_iterator i= mat_vector::begin();i!=mat_vector::end();i++)
714  retval.insert((*i)->getTag());
715  return retval;
716  }
717 
719 template <class MAT>
720 boost::python::list MaterialVector<MAT>::getTagsPy(void) const
721  {
722  boost::python::list retval;
723  std::set<int> tmp= getTags();
724  for(std::set<int>::const_iterator i= tmp.begin();i!=tmp.end();i++)
725  retval.append(*i);
726  return retval;
727  }
728 
730 template <class MAT>
732  {
733  inicComm(2);
734  int res= sendData(comm);
735  const int dataTag=getDbTag();
736  res+= comm.sendIdData(getDbTagData(),dataTag);
737  if(res < 0)
738  std::cerr << Color::red << getClassName() << "::" << __FUNCTION__
739  << dataTag << " failed to send ID"
740  << Color::def << std::endl;
741  return res;
742  }
743 
745 template <class MAT>
747  {
748  const int dataTag= this->getDbTag();
749  inicComm(2);
750  int res= comm.receiveIdData(getDbTagData(),dataTag);
751  if(res<0)
752  std::cerr << Color::red << getClassName() << "::" << __FUNCTION__
753  << dataTag << " failed to receive ID"
754  << Color::def << std::endl;
755  else
756  res+= recvData(comm);
757  return res;
758  }
759 
760 } // end of XC namespace
761 
762 #endif
int sendIdData(const DbTagData &, const int &)
Sends miembro data through the communicator argument.
Definition: Communicator.cc:411
Matrix getGeneralizedStress(const int &defID) const
Returns the defID component of generalized stress vector on each integration point.
Definition: MaterialVector.h:560
virtual int getComponentIdFromString(const std::string &str) const
Return the identifier of the response component from the given label (something like &#39;Mz&#39; or &#39;N&#39;...
Definition: ResponseId.cc:167
int sendBrokedPtr(MovableObject *ptr, DbTagData &, const BrokedPtrCommMetaData &)
Sends a pointer to movable object through the communicator argument.
Definition: Communicator.cc:1204
int sendSelf(Communicator &)
Sends object through the communicator argument.
Definition: MaterialVector.h:731
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
void alloc(const std::vector< MAT *> &mats)
Copy materials from another vector.
Definition: MaterialVector.h:138
Object that can return properties as Python objects.
Definition: EntityWithProperties.h:32
int revertToLastCommit(void)
Returns materials to its last committed state.
Definition: MaterialVector.h:332
std::set< std::string > getNames(void) const
Return the names of the materials.
Definition: MaterialVector.h:689
void setInitialGeneralizedStrains(const std::vector< Vector > &)
Assigns initial values to materials initial strains.
Definition: MaterialVector.h:597
Object that can move between processes.
Definition: MovableObject.h:100
const Vector & getMeanGeneralizedStress(void) const
Returns average generalized stress values on element. In a future we can enhance this by providing an...
Definition: MaterialVector.h:435
int send(DbTagData &, Communicator &, const CommMetaData &) const
Sends the object.
Definition: DbTagData.cc:102
bool empty(void) const
Returns true ifno se ha asignado material.
Definition: MaterialVector.h:303
Vector getGeneralizedStrainAtGaussPoints(const int &) const
Returns the defID component of the strain vector at Gauss points.
Definition: MaterialVector.h:496
Base class for materials.
Definition: Material.h:93
int noCols() const
Returns the number of columns, numCols, of the Matrix.
Definition: Matrix.h:273
Vector that stores the dbTags of the class members.
Definition: DbTagData.h:44
Matrix getGeneralizedStresses(void) const
Returns generalized stress values on each integration point.
Definition: MaterialVector.h:404
Data about the index, size,,...
Definition: CommMetaData.h:39
boost::python::list getNamesPy(void) const
Return the names of the materials in a python list.
Definition: MaterialVector.h:699
size_t getGeneralizedStrainSize(void) const
Returns the size of generalized strains vector.
Definition: MaterialVector.h:399
void copyPropsFrom(const EntityWithProperties *)
copy the user defined properties of the given object on each of the materials.
Definition: MaterialVector.h:276
int receive(DbTagData &, const Communicator &, const CommMetaData &)
Receive the object.
Definition: DbTagData.cc:106
Vector getGeneralizedStressAtGaussPoints(const int &) const
Returns the defID component of the stress vector at Gauss points.
Definition: MaterialVector.h:541
void incrementInitialGeneralizedStrains(const std::vector< Vector > &)
Adds to the materials initial strains the values being passed as parameters.
Definition: MaterialVector.h:613
boost::python::list getTagsPy(void) const
Return the identifiers of the materials in a python list.
Definition: MaterialVector.h:720
MaterialVector< MAT > & operator=(const MaterialVector< MAT > &)
Assignment operator.
Definition: MaterialVector.h:162
Material pointer container.
Definition: MaterialVector.h:49
Matrix getGeneralizedStrain(const int &defID) const
Returns the defID component of generalized strain vector on each integration point.
Definition: MaterialVector.h:579
size_t getGeneralizedStressSize(void) const
Returns the size of stress vector.
Definition: MaterialVector.h:394
int recvSelf(const Communicator &)
Receives object through the communicator argument.
Definition: MaterialVector.h:746
std::set< int > getTags(void) const
Return the identifiers of the materials.
Definition: MaterialVector.h:710
std::deque< int > getComponentIndexesFromCode(const std::string &code) const
Return the strain or stress vector index corresponding to the given code.
Definition: MaterialVector.h:462
Objet that can execute python scripts.
Definition: CommandEntity.h:40
Stiffness material contribution response identifiers.
Definition: ResponseId.h:68
void copyPropsFrom(const EntityWithProperties &)
Copy the properties from the argument.
Definition: EntityWithProperties.cc:82
int noRows() const
Returns the number of rows, numRows, of the Matrix.
Definition: Matrix.h:269
const Vector & getMeanGeneralizedStrain(void) const
Returns average generalized strain values on element.In a future we can enhance this by providing an ...
Definition: MaterialVector.h:448
int sendData(Communicator &)
Send object members through the communicator argument.
Definition: MaterialVector.h:647
virtual TaggedObject * getCopy(void) const
Virtual constructor.
Definition: TaggedObject.cpp:83
Matrix getGeneralizedStrains(void) const
Returns generalized strain values on each integration point.
Definition: MaterialVector.h:419
int commitState(void)
Commits materials state (normally after convergence).
Definition: MaterialVector.h:321
void zeroInitialGeneralizedStrains(void)
Initialize initial strains.
Definition: MaterialVector.h:629
Data to transmit for a pointer «broked».
Definition: BrokedPtrCommMetaData.h:40
std::deque< int > getComponentIndexesFromCode(const int &) const
Return the strain or stress vector indexes corresponding to the given code.
Definition: ResponseId.cc:124
int receiveIdData(DbTagData &, const int &) const
Receives el miembro data through the communicator argument.
Definition: Communicator.cc:415
int recvData(const Communicator &)
Receives object through the communicator argument.
Definition: MaterialVector.h:667
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Matrix of floats.
Definition: Matrix.h:111
DbTagData & getDbTagData(void) const
Returns a vector to store the dbTags of the class members.
Definition: MaterialVector.h:639
Matrix getValues(const std::string &, bool silent=false) const
Ask the materials about the values that correspond to the code.
Definition: MaterialVector.h:358
int revertToStart(void)
Return materials to its initial state.
Definition: MaterialVector.h:344
void putRow(int, const Vector &)
Put the vector at the i-th row.
Definition: Matrix.cpp:1118
MaterialVector(const size_t &nMat, const MAT *matModel=nullptr)
Default constructor.
Definition: MaterialVector.h:122
int Size(void) const
Returns the vector size.
Definition: ID.h:116