KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
mesh.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Pooyan Dadvand
11 //
12 //
13 
14 #pragma once
15 
16 // System includes
17 #include <string>
18 #include <iostream>
19 #include <sstream>
20 #include <cstddef>
21 
22 // External includes
23 
24 // Project includes
25 #include "includes/define.h"
29 #include "geometries/geometry.h"
30 #include "containers/flags.h"
33 
34 namespace Kratos
35 {
36 
39 
43 
47 
51 
55 
67 template<class TNodeType, class TPropertiesType, class TElementType, class TConditionType>
68 class Mesh : public DataValueContainer, public Flags
69 {
70 public:
73 
76 
77  // Alias for representing indices, typically used for indexing arrays or collections.
78  using IndexType = std::size_t;
79 
80  // Alias for representing sizes or counts, commonly used to indicate the size of data structures.
81  using SizeType = std::size_t;
82 
83  // Alias for representing node types in a mesh data structure.
84  using NodeType = TNodeType;
85 
86  // Alias for representing properties associated with nodes or elements in a mesh.
87  using PropertiesType = TPropertiesType;
88 
89  // Alias for representing the geometry associated with a specific node type.
91 
92  // Alias for representing element types in a mesh data structure.
93  using ElementType = TElementType;
94 
95  // Alias for representing condition types in a mesh data structure.
96  using ConditionType = TConditionType;
97 
98  // Alias for representing master-slave constraints that can be applied in the mesh.
100 
101  // Alias for the complete mesh data structure, including nodes, properties, elements, and conditions.
103 
107  std::less<typename IndexedObject::result_type>,
108  std::equal_to<typename IndexedObject::result_type>,
109  typename NodeType::Pointer,
110  std::vector<typename NodeType::Pointer>
111  >;
112 
115 
118 
121 
124 
127 
131  std::less<typename IndexedObject::result_type>,
132  std::equal_to<typename IndexedObject::result_type>,
133  typename ElementType::Pointer,
134  std::vector<typename ElementType::Pointer>
135  >;
136 
139 
142 
146  std::less<typename IndexedObject::result_type>,
147  std::equal_to<typename IndexedObject::result_type>,
148  typename ConditionType::Pointer,
149  std::vector<typename ConditionType::Pointer>
150  >;
151 
154 
157 
160 
163 
166 
170 
172  Mesh() : Flags()
173  , mpNodes(new NodesContainerType())
174  , mpProperties(new PropertiesContainerType())
175  , mpElements(new ElementsContainerType())
176  , mpConditions(new ConditionsContainerType())
177  , mpMasterSlaveConstraints(new MasterSlaveConstraintContainerType()) {}
178 
180  Mesh(Mesh const& rOther) : Flags(rOther)
181  , mpNodes(rOther.mpNodes)
182  , mpProperties(rOther.mpProperties)
183  , mpElements(rOther.mpElements)
184  , mpConditions(rOther.mpConditions)
185  , mpMasterSlaveConstraints(rOther.mpMasterSlaveConstraints) {}
186 
188  Mesh(typename NodesContainerType::Pointer NewNodes,
189  typename PropertiesContainerType::Pointer NewProperties,
190  typename ElementsContainerType::Pointer NewElements,
191  typename ConditionsContainerType::Pointer NewConditions,
192  typename MasterSlaveConstraintContainerType::Pointer NewMasterSlaveConditions)
193  : Flags(), mpNodes(NewNodes), mpProperties(NewProperties) , mpElements(NewElements), mpConditions(NewConditions), mpMasterSlaveConstraints(NewMasterSlaveConditions) {}
194 
195 
197  ~Mesh() override {}
198 
202 
206 
208  {
209  typename NodesContainerType::Pointer p_nodes(new NodesContainerType(*mpNodes));
210  typename PropertiesContainerType::Pointer p_properties(new PropertiesContainerType(*mpProperties));
211  typename ElementsContainerType::Pointer p_elements(new ElementsContainerType(*mpElements));
212  typename ConditionsContainerType::Pointer p_conditions(new ConditionsContainerType(*mpConditions));
213  typename MasterSlaveConstraintContainerType::Pointer p_master_slave_constraints(new MasterSlaveConstraintContainerType(*mpMasterSlaveConstraints));
214 
215  return Mesh(p_nodes, p_properties, p_elements, p_conditions, p_master_slave_constraints);
216  }
217 
218  void Clear()
219  {
220  Flags::Clear();
222  mpNodes->clear();
223  mpProperties->clear();
224  mpElements->clear();
225  mpConditions->clear();
226  mpMasterSlaveConstraints->clear();
227  }
228 
232 
238  {
239  SizeType dimension = 3;
240 
241  // NOTE: possible segmentation fault if a Element or Condition
242  // is created using the base class of geometry, then the mpGeometryData
243  // of the geometry is a null pointer and has not any mWorkingSpaceDimension
244  if (NumberOfElements()!=0) {
245  dimension = (mpElements->begin())->GetGeometry().WorkingSpaceDimension();
246  } else if(NumberOfConditions()!=0) {
247  dimension = (mpConditions->begin())->GetGeometry().WorkingSpaceDimension();
248  } else if(NumberOfNodes()!=0) {
249  dimension = (mpNodes->begin())->Dimension();
250  }
251 
252  return dimension;
253  }
254 
258 
260  {
261  return mpNodes->size();
262  }
263 
266  void AddNode(typename NodeType::Pointer pNewNode)
267  {
268  mpNodes->insert(mpNodes->begin(), pNewNode);
269  }
270 
272  typename NodeType::Pointer pGetNode(IndexType NodeId)
273  {
274  auto i = mpNodes->find(NodeId);
275  KRATOS_ERROR_IF(i == mpNodes->end()) << "Node index not found: " << NodeId << "." << std::endl;
276  return *i.base();
277  }
278 
280  const typename NodeType::Pointer pGetNode(const IndexType NodeId) const
281  {
282  const auto& r_nodes = *mpNodes;
283  auto i = r_nodes.find(NodeId);
284  KRATOS_ERROR_IF(i == r_nodes.end()) << "Node index not found: " << NodeId << "." << std::endl;
285  return *i.base();
286  }
287 
290  {
291  auto i = mpNodes->find(NodeId);
292  KRATOS_ERROR_IF(i == mpNodes->end()) << "Node index not found: " << NodeId << "." << std::endl;
293  return *i;
294  }
295 
297  const NodeType& GetNode(IndexType NodeId) const
298  {
299  const auto& r_nodes = *mpNodes;
300  auto i = r_nodes.find(NodeId);
301  KRATOS_ERROR_IF(i == r_nodes.end()) << "Node index not found: " << NodeId << "." << std::endl;
302  return *i;
303  }
304 
307  void RemoveNode(IndexType NodeId)
308  {
309  mpNodes->erase(NodeId);
310  }
311 
314  void RemoveNode(NodeType& ThisNode)
315  {
316  mpNodes->erase(ThisNode.Id());
317  }
318 
321  void RemoveNode(typename NodeType::Pointer pThisNode)
322  {
323  mpNodes->erase(pThisNode->Id());
324  }
325 
327  {
328  return mpNodes->begin();
329  }
330 
332  {
333  return mpNodes->begin();
334  }
335 
337  {
338  return mpNodes->end();
339  }
340 
342  {
343  return mpNodes->end();
344  }
345 
347  {
348  return *mpNodes;
349  }
350 
351  const NodesContainerType& Nodes() const
352  {
353  return *mpNodes;
354  }
355 
356  typename NodesContainerType::Pointer pNodes()
357  {
358  return mpNodes;
359  }
360 
361  void SetNodes(typename NodesContainerType::Pointer pOtherNodes)
362  {
363  mpNodes = pOtherNodes;
364  }
365 
367  {
368  return mpNodes->GetContainer();
369  }
370 
371  bool HasNode(IndexType NodeId) const
372  {
373  const auto& r_nodes = *mpNodes;
374  return (r_nodes.find(NodeId) != r_nodes.end());
375  }
376 
380 
382  {
383  return mpProperties->size();
384  }
385 
388  void AddProperties(typename PropertiesType::Pointer pNewProperties)
389  {
390  mpProperties->insert(mpProperties->begin(), pNewProperties);
391  }
392 
394  typename PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
395  {
396  return (*mpProperties)(PropertiesId);
397  }
398 
401  {
402  return (*mpProperties)[PropertiesId];
403  }
404 
407  void RemoveProperties(IndexType PropertiesId)
408  {
409  mpProperties->erase(PropertiesId);
410  }
411 
414  void RemoveProperties(PropertiesType& ThisProperties)
415  {
416  mpProperties->erase(ThisProperties.Id());
417  }
418 
421  void RemoveProperties(typename PropertiesType::Pointer pThisProperties)
422  {
423  mpProperties->erase(pThisProperties->Id());
424  }
425 
427  {
428  return mpProperties->begin();
429  }
430 
432  {
433  return mpProperties->begin();
434  }
435 
437  {
438  return mpProperties->end();
439  }
440 
442  {
443  return mpProperties->end();
444  }
445 
447  {
448  return *mpProperties;
449  }
450 
452  {
453  return *mpProperties;
454  }
455 
456  typename PropertiesContainerType::Pointer pProperties()
457  {
458  return mpProperties;
459  }
460 
461  void SetProperties(typename PropertiesContainerType::Pointer pOtherProperties)
462  {
463  mpProperties = pOtherProperties;
464  }
465 
467  {
468  return mpProperties->GetContainer();
469  }
470 
471  bool HasProperties(IndexType NodeId) const
472  {
473  const auto& r_properties = *mpProperties;
474  return (r_properties.find(NodeId) != r_properties.end());
475  }
476 
480 
482  {
483  return mpElements->size();
484  }
485 
488  void AddElement(typename ElementType::Pointer pNewElement)
489  {
490  mpElements->insert(mpElements->begin(), pNewElement);
491  }
492 
494  typename ElementType::Pointer pGetElement(IndexType ElementId)
495  {
496  auto i = mpElements->find(ElementId);
497  KRATOS_ERROR_IF(i == mpElements->end()) << "Element index not found: " << ElementId << "." << std::endl;
498  return *i.base();
499  }
500 
502  const typename ElementType::Pointer pGetElement(const IndexType ElementId) const
503  {
504  const auto& r_elements = *mpElements;
505  auto i = r_elements.find(ElementId);
506  KRATOS_ERROR_IF(i == r_elements.end()) << "Element index not found: " << ElementId << "." << std::endl;
507  return *i.base();
508  }
509 
512  {
513  auto i = mpElements->find(ElementId);
514  KRATOS_ERROR_IF(i == mpElements->end()) << "Element index not found: " << ElementId << "." << std::endl;
515  return *i;
516  }
517 
519  const ElementType& GetElement(IndexType ElementId) const
520  {
521  const auto& r_elements = *mpElements;
522  auto i = r_elements.find(ElementId);
523  KRATOS_ERROR_IF(i == r_elements.end()) << "Element index not found: " << ElementId << "." << std::endl;
524  return *i;
525  }
526 
529  void RemoveElement(IndexType ElementId)
530  {
531  mpElements->erase(ElementId);
532  }
533 
536  void RemoveElement(ElementType& ThisElement)
537  {
538  mpElements->erase(ThisElement.Id());
539  }
540 
543  void RemoveElement(typename ElementType::Pointer pThisElement)
544  {
545  mpElements->erase(pThisElement->Id());
546  }
547 
549  {
550  return mpElements->begin();
551  }
552 
554  {
555  return mpElements->begin();
556  }
557 
559  {
560  return mpElements->end();
561  }
562 
564  {
565  return mpElements->end();
566  }
567 
569  {
570  return *mpElements;
571  }
572 
574  {
575  return *mpElements;
576  }
577 
578  typename ElementsContainerType::Pointer pElements()
579  {
580  return mpElements;
581  }
582 
583  void SetElements(typename ElementsContainerType::Pointer pOtherElements)
584  {
585  mpElements = pOtherElements;
586  }
587 
589  {
590  return mpElements->GetContainer();
591  }
592 
593 
594  bool HasElement(IndexType ElementId) const
595  {
596  const auto& r_elements = *mpElements;
597  return (r_elements.find(ElementId) != r_elements.end());
598  }
599 
603 
605  {
606  return mpConditions->size();
607  }
608 
611  void AddCondition(typename ConditionType::Pointer pNewCondition)
612  {
613  mpConditions->insert(mpConditions->begin(), pNewCondition);
614  }
615 
617  typename ConditionType::Pointer pGetCondition(IndexType ConditionId)
618  {
619  auto i = mpConditions->find(ConditionId);
620  KRATOS_ERROR_IF(i == mpConditions->end()) << "Condition index not found: " << ConditionId << "." << std::endl;
621  return *i.base();
622  }
623 
625  const typename ConditionType::Pointer pGetCondition(const IndexType ConditionId) const
626  {
627  const auto& r_conditions = *mpConditions;
628  auto i = r_conditions.find(ConditionId);
629  KRATOS_ERROR_IF(i == r_conditions.end()) << "Condition index not found: " << ConditionId << "." << std::endl;
630  return *i.base();
631  }
632 
635  {
636  auto i = mpConditions->find(ConditionId);
637  KRATOS_ERROR_IF(i == mpConditions->end()) << "Condition index not found: " << ConditionId << "." << std::endl;
638  return *i;
639  }
640 
642  const ConditionType& GetCondition(IndexType ConditionId) const
643  {
644  const auto& r_conditions = *mpConditions;
645  auto i = r_conditions.find(ConditionId);
646  KRATOS_ERROR_IF(i == r_conditions.end()) << "Condition index not found: " << ConditionId << "." << std::endl;
647  return *i;
648  }
649 
652  void RemoveCondition(IndexType ConditionId)
653  {
654  mpConditions->erase(ConditionId);
655  }
656 
659  void RemoveCondition(ConditionType& ThisCondition)
660  {
661  mpConditions->erase(ThisCondition.Id());
662  }
663 
666  void RemoveCondition(typename ConditionType::Pointer pThisCondition)
667  {
668  mpConditions->erase(pThisCondition->Id());
669  }
670 
672  {
673  return mpConditions->begin();
674  }
675 
677  {
678  return mpConditions->begin();
679  }
680 
682  {
683  return mpConditions->end();
684  }
685 
687  {
688  return mpConditions->end();
689  }
690 
692  {
693  return *mpConditions;
694  }
695 
697  {
698  return *mpConditions;
699  }
700 
701  typename ConditionsContainerType::Pointer pConditions()
702  {
703  return mpConditions;
704  }
705 
706  void SetConditions(typename ConditionsContainerType::Pointer pOtherConditions)
707  {
708  mpConditions = pOtherConditions;
709  }
710 
712  {
713  return mpConditions->GetContainer();
714  }
715 
716  bool HasCondition(IndexType ConditionId) const
717  {
718  const auto& r_conditions = *mpConditions;
719  return (r_conditions.find(ConditionId) != r_conditions.end());
720  }
721 
725 
727  {
728  return mpMasterSlaveConstraints->size();
729  }
730 
733  void AddMasterSlaveConstraint(typename MasterSlaveConstraintType::Pointer pNewMasterSlaveConstraint)
734  {
735  mpMasterSlaveConstraints->insert(mpMasterSlaveConstraints->begin(), pNewMasterSlaveConstraint);
736  }
737 
739  typename MasterSlaveConstraintType::Pointer pGetMasterSlaveConstraint(IndexType MasterSlaveConstraintId)
740  {
741  auto i = mpMasterSlaveConstraints->find(MasterSlaveConstraintId);
742  KRATOS_ERROR_IF(i == mpMasterSlaveConstraints->end()) << " master-slave constraint index not found: " << MasterSlaveConstraintId << ".";
743  return *i.base();
744  }
745 
748  {
749  auto i = mpMasterSlaveConstraints->find(MasterSlaveConstraintId);
750  KRATOS_ERROR_IF(i == mpMasterSlaveConstraints->end()) << " master-slave constraint index not found: " << MasterSlaveConstraintId << ".";
751  return *i;
752  }
753 
754  const MasterSlaveConstraintType& GetMasterSlaveConstraint(IndexType MasterSlaveConstraintId) const
755  {
756  auto i = mpMasterSlaveConstraints->find(MasterSlaveConstraintId);
757  KRATOS_ERROR_IF(i == mpMasterSlaveConstraints->end()) << " master-slave constraint index not found: " << MasterSlaveConstraintId << ".";
758  return *i;
759  }
760 
763  void RemoveMasterSlaveConstraint(IndexType MasterSlaveConstraintId)
764  {
765  mpMasterSlaveConstraints->erase(MasterSlaveConstraintId);
766  }
767 
771  {
772  mpMasterSlaveConstraints->erase(ThisMasterSlaveConstraint.Id());
773  }
774 
777  void RemoveMasterSlaveConstraint(typename MasterSlaveConstraintType::Pointer pThisMasterSlaveConstraint)
778  {
779  mpMasterSlaveConstraints->erase(pThisMasterSlaveConstraint->Id());
780  }
781 
783  {
784  return mpMasterSlaveConstraints->begin();
785  }
786 
788  {
789  return mpMasterSlaveConstraints->begin();
790  }
791 
793  {
794  return mpMasterSlaveConstraints->end();
795  }
796 
798  {
799  return mpMasterSlaveConstraints->end();
800  }
801 
803  {
804  return *mpMasterSlaveConstraints;
805  }
806 
808  {
809  return *mpMasterSlaveConstraints;
810  }
811 
812  typename MasterSlaveConstraintContainerType::Pointer pMasterSlaveConstraints()
813  {
814  return mpMasterSlaveConstraints;
815  }
816 
818  {
819  return mpMasterSlaveConstraints->GetContainer();
820  }
821 
822  bool HasMasterSlaveConstraint(IndexType MasterSlaveConstraintId) const
823  {
824  return (mpMasterSlaveConstraints->find(MasterSlaveConstraintId) != mpMasterSlaveConstraints->end());
825  }
826 
830 
834 
838 
840  std::string Info() const override
841  {
842  return "Mesh";
843  }
844 
846  void PrintInfo(std::ostream& rOStream) const override
847  {
848  rOStream << Info();
849  }
850 
852  void PrintData(std::ostream& rOStream) const override
853  {
854  rOStream << " Number of Nodes : " << mpNodes->size() << std::endl;
855  rOStream << " Number of Properties : " << mpProperties->size() << std::endl;
856  rOStream << " Number of Elements : " << mpElements->size() << std::endl;
857  rOStream << " Number of Conditions : " << mpConditions->size() << std::endl;
858  rOStream << " Number of Constraints : " << mpMasterSlaveConstraints->size() << std::endl;
859  }
860 
862  virtual void PrintInfo(std::ostream& rOStream, std::string const& PrefixString) const
863  {
864  rOStream << PrefixString << Info();
865  }
866 
868  virtual void PrintData(std::ostream& rOStream, std::string const& PrefixString ) const
869  {
870  rOStream << PrefixString << " Number of Nodes : " << mpNodes->size() << std::endl;
871  rOStream << PrefixString << " Number of Properties : " << mpProperties->size() << std::endl;
872  rOStream << PrefixString << " Number of Elements : " << mpElements->size() << std::endl;
873  rOStream << PrefixString << " Number of Conditions : " << mpConditions->size() << std::endl;
874  rOStream << PrefixString << " Number of Constraints : " << mpMasterSlaveConstraints->size() << std::endl;
875  }
876 
880 
882 protected:
885 
889 
893 
897 
901 
905 
909 
911 private:
914 
918 
919  typename NodesContainerType::Pointer mpNodes;
920 
921  typename PropertiesContainerType::Pointer mpProperties;
922 
923  typename ElementsContainerType::Pointer mpElements;
924 
925  typename ConditionsContainerType::Pointer mpConditions;
926 
927  typename MasterSlaveConstraintContainerType::Pointer mpMasterSlaveConstraints;
928 
929 
933 
937 
941 
942  friend class Serializer;
943 
944  void save(Serializer& rSerializer) const override
945  {
948  rSerializer.save("Nodes",mpNodes);
949  rSerializer.save("Properties",mpProperties);
950  rSerializer.save("Elements",mpElements);
951  rSerializer.save("Conditions",mpConditions);
952  rSerializer.save("Constraints",mpMasterSlaveConstraints);
953  }
954 
955  void load(Serializer& rSerializer) override
956  {
959  rSerializer.load("Nodes",mpNodes);
960  rSerializer.load("Properties",mpProperties);
961  rSerializer.load("Elements",mpElements);
962  rSerializer.load("Conditions",mpConditions);
963  rSerializer.load("Constraints",mpMasterSlaveConstraints);
964  }
965 
966 
970 
974 
978 
980  Mesh& operator=(const Mesh& rOther)
981  {
982  Flags::operator =(rOther);
983  mpNodes = rOther.mpNodes;
984  mpProperties = rOther.mpProperties;
985  mpElements = rOther.mpElements;
986  mpConditions = rOther.mpConditions;
987  mpMasterSlaveConstraints = rOther.mpMasterSlaveConstraints;
988  }
989 
990 
992 
993 }; // Class Mesh
994 
998 
1002 
1004 template<class TNodeType, class TPropertiesType, class TElementType, class TConditionType>
1005 inline std::istream& operator >> (std::istream& rIStream,
1007 
1009 template<class TNodeType, class TPropertiesType, class TElementType, class TConditionType>
1010 inline std::ostream& operator << (std::ostream& rOStream,
1012 {
1013  rThis.PrintInfo(rOStream);
1014  rOStream << std::endl;
1015  rThis.PrintData(rOStream);
1016 
1017  return rOStream;
1018 }
1020 
1021 
1022 } // namespace Kratos.
1023 
1024 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
Container for storing data values associated with variables.
Definition: data_value_container.h:63
ContainerType::size_type SizeType
Type of the container used for variables.
Definition: data_value_container.h:87
void Clear()
Clears the entire data container.
Definition: data_value_container.h:352
Definition: flags.h:58
std::size_t IndexType
Definition: flags.h:74
Flags & operator=(Flags const &rOther)
Assignment operator.
Definition: flags.h:151
void Clear()
Definition: flags.h:235
Geometry base class.
Definition: geometry.h:71
This object defines an indexed object.
Definition: indexed_object.h:54
IndexType Id() const
Definition: indexed_object.h:107
A class that implements the interface for different master-slave constraints to be applied on a syste...
Definition: master_slave_constraint.h:76
Mesh is the second level of abstraction in the data structure which hold Nodes, Elements and Conditio...
Definition: mesh.h:69
void RemoveMasterSlaveConstraint(IndexType MasterSlaveConstraintId)
Definition: mesh.h:763
PropertiesConstantIterator PropertiesBegin() const
Definition: mesh.h:431
SizeType NumberOfNodes() const
Definition: mesh.h:259
PointerVectorSet< PropertiesType, IndexedObject > PropertiesContainerType
Type alias for the container of properties.
Definition: mesh.h:120
SizeType NumberOfElements() const
Definition: mesh.h:481
PropertiesIterator PropertiesEnd()
Definition: mesh.h:436
const ElementsContainerType & Elements() const
Definition: mesh.h:573
std::string Info() const override
Turn back information as a string.
Definition: mesh.h:840
SizeType NumberOfConditions() const
Definition: mesh.h:604
MasterSlaveConstraintIteratorType MasterSlaveConstraintsBegin()
Definition: mesh.h:782
void SetConditions(typename ConditionsContainerType::Pointer pOtherConditions)
Definition: mesh.h:706
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mesh.h:846
ElementsContainerType::Pointer pElements()
Definition: mesh.h:578
const ConditionType::Pointer pGetCondition(const IndexType ConditionId) const
Definition: mesh.h:625
ElementType::Pointer pGetElement(IndexType ElementId)
Definition: mesh.h:494
NodesContainerType::ContainerType & NodesArray()
Definition: mesh.h:366
const PropertiesContainerType & Properties() const
Definition: mesh.h:451
void RemoveProperties(IndexType PropertiesId)
Definition: mesh.h:407
PropertiesConstantIterator PropertiesEnd() const
Definition: mesh.h:441
KRATOS_CLASS_POINTER_DEFINITION(Mesh)
Pointer definition of Mesh.
ConditionsContainerType & Conditions()
Definition: mesh.h:691
void RemoveNode(IndexType NodeId)
Definition: mesh.h:307
ElementIterator ElementsEnd()
Definition: mesh.h:558
void RemoveProperties(PropertiesType &ThisProperties)
Definition: mesh.h:414
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mesh.h:852
ElementIterator ElementsBegin()
Definition: mesh.h:548
PropertiesContainerType::Pointer pProperties()
Definition: mesh.h:456
Mesh(Mesh const &rOther)
Copy constructor.
Definition: mesh.h:180
bool HasCondition(IndexType ConditionId) const
Definition: mesh.h:716
ElementConstantIterator ElementsEnd() const
Definition: mesh.h:563
Mesh()
Default constructor.
Definition: mesh.h:172
ConditionConstantIterator ConditionsEnd() const
Definition: mesh.h:686
NodesContainerType & Nodes()
Definition: mesh.h:346
typename NodesContainerType::const_iterator NodeConstantIterator
Const iterator for nodes in the container. Provides direct references to nodes.
Definition: mesh.h:117
MasterSlaveConstraintType::Pointer pGetMasterSlaveConstraint(IndexType MasterSlaveConstraintId)
Definition: mesh.h:739
void RemoveCondition(ConditionType &ThisCondition)
Definition: mesh.h:659
~Mesh() override
Destructor.
Definition: mesh.h:197
MasterSlaveConstraintConstantIteratorType MasterSlaveConstraintsEnd() const
Definition: mesh.h:797
PropertiesType & GetProperties(IndexType PropertiesId)
Definition: mesh.h:400
SizeType NumberOfMasterSlaveConstraints() const
Definition: mesh.h:726
bool HasElement(IndexType ElementId) const
Definition: mesh.h:594
MasterSlaveConstraintType & GetMasterSlaveConstraint(IndexType MasterSlaveConstraintId)
Definition: mesh.h:747
PropertiesIterator PropertiesBegin()
Definition: mesh.h:426
ConditionIterator ConditionsBegin()
Definition: mesh.h:671
void SetNodes(typename NodesContainerType::Pointer pOtherNodes)
Definition: mesh.h:361
MasterSlaveConstraintContainerType & MasterSlaveConstraints()
Definition: mesh.h:802
void RemoveElement(typename ElementType::Pointer pThisElement)
Definition: mesh.h:543
ConditionsContainerType::Pointer pConditions()
Definition: mesh.h:701
void RemoveNode(typename NodeType::Pointer pThisNode)
Definition: mesh.h:321
void RemoveProperties(typename PropertiesType::Pointer pThisProperties)
Definition: mesh.h:421
bool HasNode(IndexType NodeId) const
Definition: mesh.h:371
NodeIterator NodesEnd()
Definition: mesh.h:336
typename PropertiesContainerType::iterator PropertiesIterator
Iterator for properties in the container. Provides direct references to properties.
Definition: mesh.h:123
ConditionsContainerType::ContainerType & ConditionsArray()
Definition: mesh.h:711
SizeType WorkingSpaceDimension() const
Definition: mesh.h:237
typename ConditionsContainerType::iterator ConditionIterator
Iterator for conditions in the container. Provides direct references to conditions.
Definition: mesh.h:153
ElementsContainerType::ContainerType & ElementsArray()
Definition: mesh.h:588
TPropertiesType PropertiesType
Definition: mesh.h:87
PointerVectorSet< ElementType, IndexedObject, std::less< typename IndexedObject::result_type >, std::equal_to< typename IndexedObject::result_type >, typename ElementType::Pointer, std::vector< typename ElementType::Pointer > > ElementsContainerType
Type alias for the container of elements.
Definition: mesh.h:135
ElementType & GetElement(IndexType ElementId)
Definition: mesh.h:511
ConditionType::Pointer pGetCondition(IndexType ConditionId)
Definition: mesh.h:617
typename NodesContainerType::iterator NodeIterator
Iterator for nodes in the container. Provides direct references to nodes.
Definition: mesh.h:114
void RemoveMasterSlaveConstraint(MasterSlaveConstraintType &ThisMasterSlaveConstraint)
Definition: mesh.h:770
MasterSlaveConstraintConstantIteratorType MasterSlaveConstraintsBegin() const
Definition: mesh.h:787
virtual void PrintData(std::ostream &rOStream, std::string const &PrefixString) const
Print object's data.
Definition: mesh.h:868
void SetProperties(typename PropertiesContainerType::Pointer pOtherProperties)
Definition: mesh.h:461
bool HasProperties(IndexType NodeId) const
Definition: mesh.h:471
void RemoveMasterSlaveConstraint(typename MasterSlaveConstraintType::Pointer pThisMasterSlaveConstraint)
Definition: mesh.h:777
MasterSlaveConstraintIteratorType MasterSlaveConstraintsEnd()
Definition: mesh.h:792
void AddCondition(typename ConditionType::Pointer pNewCondition)
Definition: mesh.h:611
const NodesContainerType & Nodes() const
Definition: mesh.h:351
PointerVectorSet< NodeType, IndexedObject, std::less< typename IndexedObject::result_type >, std::equal_to< typename IndexedObject::result_type >, typename NodeType::Pointer, std::vector< typename NodeType::Pointer > > NodesContainerType
Type alias for the container of nodes.
Definition: mesh.h:111
typename ConditionsContainerType::const_iterator ConditionConstantIterator
Const iterator for conditions in the container. Provides direct references to conditions.
Definition: mesh.h:156
typename ElementsContainerType::const_iterator ElementConstantIterator
Const iterator for elements in the container. Provides direct references to elements.
Definition: mesh.h:141
void RemoveNode(NodeType &ThisNode)
Definition: mesh.h:314
SizeType NumberOfProperties() const
Definition: mesh.h:381
void RemoveElement(ElementType &ThisElement)
Definition: mesh.h:536
const ElementType & GetElement(IndexType ElementId) const
Definition: mesh.h:519
NodesContainerType::Pointer pNodes()
Definition: mesh.h:356
ConditionConstantIterator ConditionsBegin() const
Definition: mesh.h:676
ElementConstantIterator ElementsBegin() const
Definition: mesh.h:553
NodeIterator NodesBegin()
Definition: mesh.h:326
PropertiesType::Pointer pGetProperties(IndexType PropertiesId)
Definition: mesh.h:394
NodeConstantIterator NodesEnd() const
Definition: mesh.h:341
TNodeType NodeType
Definition: mesh.h:84
typename ElementsContainerType::iterator ElementIterator
Iterator for elements in the container. Provides direct references to elements.
Definition: mesh.h:138
PropertiesContainerType & Properties()
Definition: mesh.h:446
const ElementType::Pointer pGetElement(const IndexType ElementId) const
Definition: mesh.h:502
typename PropertiesContainerType::const_iterator PropertiesConstantIterator
Const iterator for properties in the container. Provides direct references to properties.
Definition: mesh.h:126
MasterSlaveConstraintContainerType::Pointer pMasterSlaveConstraints()
Definition: mesh.h:812
void AddNode(typename NodeType::Pointer pNewNode)
Definition: mesh.h:266
NodeType::Pointer pGetNode(IndexType NodeId)
Definition: mesh.h:272
void AddElement(typename ElementType::Pointer pNewElement)
Definition: mesh.h:488
const NodeType::Pointer pGetNode(const IndexType NodeId) const
Definition: mesh.h:280
bool HasMasterSlaveConstraint(IndexType MasterSlaveConstraintId) const
Definition: mesh.h:822
virtual void PrintInfo(std::ostream &rOStream, std::string const &PrefixString) const
Print information about this object.
Definition: mesh.h:862
void SetElements(typename ElementsContainerType::Pointer pOtherElements)
Definition: mesh.h:583
NodeType & GetNode(IndexType NodeId)
Definition: mesh.h:289
ElementsContainerType & Elements()
Definition: mesh.h:568
TElementType ElementType
Definition: mesh.h:93
PropertiesContainerType::ContainerType & PropertiesArray()
Definition: mesh.h:466
MasterSlaveConstraintContainerType::ContainerType & MasterSlaveConstraintsArray()
Definition: mesh.h:817
ConditionType & GetCondition(IndexType ConditionId)
Definition: mesh.h:634
void AddProperties(typename PropertiesType::Pointer pNewProperties)
Definition: mesh.h:388
void AddMasterSlaveConstraint(typename MasterSlaveConstraintType::Pointer pNewMasterSlaveConstraint)
Definition: mesh.h:733
NodeConstantIterator NodesBegin() const
Definition: mesh.h:331
void RemoveElement(IndexType ElementId)
Definition: mesh.h:529
const ConditionType & GetCondition(IndexType ConditionId) const
Definition: mesh.h:642
const NodeType & GetNode(IndexType NodeId) const
Definition: mesh.h:297
void Clear()
Definition: mesh.h:218
Mesh(typename NodesContainerType::Pointer NewNodes, typename PropertiesContainerType::Pointer NewProperties, typename ElementsContainerType::Pointer NewElements, typename ConditionsContainerType::Pointer NewConditions, typename MasterSlaveConstraintContainerType::Pointer NewMasterSlaveConditions)
Components constructor.
Definition: mesh.h:188
Mesh Clone()
Definition: mesh.h:207
PointerVectorSet< ConditionType, IndexedObject, std::less< typename IndexedObject::result_type >, std::equal_to< typename IndexedObject::result_type >, typename ConditionType::Pointer, std::vector< typename ConditionType::Pointer > > ConditionsContainerType
Type alias for the container of conditions.
Definition: mesh.h:150
ConditionIterator ConditionsEnd()
Definition: mesh.h:681
PointerVectorSet< MasterSlaveConstraintType, IndexedObject > MasterSlaveConstraintContainerType
Type alias for the container of master-slave constraints.
Definition: mesh.h:159
const ConditionsContainerType & Conditions() const
Definition: mesh.h:696
void RemoveCondition(typename ConditionType::Pointer pThisCondition)
Definition: mesh.h:666
typename MasterSlaveConstraintContainerType::const_iterator MasterSlaveConstraintConstantIteratorType
Const iterator for master-slave constraints in the container. Provides direct references to constrain...
Definition: mesh.h:165
typename MasterSlaveConstraintContainerType::iterator MasterSlaveConstraintIteratorType
Iterator for master-slave constraints in the container. Provides direct references to constraints.
Definition: mesh.h:162
const MasterSlaveConstraintContainerType & MasterSlaveConstraints() const
Definition: mesh.h:807
TConditionType ConditionType
Definition: mesh.h:96
const MasterSlaveConstraintType & GetMasterSlaveConstraint(IndexType MasterSlaveConstraintId) const
Definition: mesh.h:754
void RemoveCondition(IndexType ConditionId)
Definition: mesh.h:652
A sorted associative container similar to an STL set, but uses a vector to store pointers to its data...
Definition: pointer_vector_set.h:72
boost::indirect_iterator< typename TContainerType::iterator > iterator
Definition: pointer_vector_set.h:95
TContainerType ContainerType
Definition: pointer_vector_set.h:90
boost::indirect_iterator< typename TContainerType::const_iterator > const_iterator
Definition: pointer_vector_set.h:96
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
int dimension
Definition: isotropic_damage_automatic_differentiation.py:123
def load(f)
Definition: ode_solve.py:307
integer i
Definition: TensorModule.f:17