GemaCoreLib
The GeMA Core library
gmContactBoundaryCondition.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_CONTACT_BOUNDARY_CONDITION_H_
25 #define _GEMA_CONTACT_BOUNDARY_CONDITION_H_
26 
27 #include "gmBoundaryCondition.h"
28 
30 
33 {
34 public:
37  BcType bcType)
38  : GmBoundaryConditionBase(id, description, type, mesh, bcType) { _global = false; _materialAc = NULL; }
39 
40  virtual ~GmContactBoundaryCondition();
41 
43  bool isGlobal() const { return _global; }
44 
46  int numPropertyValues() const { return _propertyMaterialIds.size(); }
47 
48  GmContactBoundaryConditionAccessor* propertyAccessor(QString propertyId, Unit desiredUnit, const GmLogCategory& logger) const;
49  GmValueAccessor* materialAccessor(const GmLogCategory& logger) const;
50 
52  const QStringList& materialList() const { return _materialList; }
53 
54  int addPropertyLines(int n = 1);
55  void setMaterialList(const QStringList& matList);
56  bool setPropertyMaterialId(int contactIndex, const QString& id);
57  bool rebuildMaterialMapping(const GmLogCategory& logger);
58 
59  static GmContactBoundaryCondition* loadFromTable(LuaTable& tab, GmSimulationData* data, const GmLogCategory& logger);
60 
61  int contactIndex(int bcIndex1, int bcIndex2) const;
62 
63 protected:
65  virtual QString msgPrefix() const { return "contact "; }
66 
67  virtual void printExtraHeaderInfo (const GmLogCategory& logger, GmLogLevel level) const;
68  virtual void printExtraPropertyValues(const GmLogCategory& logger, GmLogLevel level) const;
69 
70 private:
71  bool parseMaterialPair(QString matId, const QMap<QString, double>& matMap,
72  int* firstIndex, int* secondIndex);
73 
74  bool _global;
78 
88 };
89 
90 
91 #endif
92 
A class used to represent a set of contact boundary conditions of the same type, tied to the same mes...
Definition: gmContactBoundaryCondition.h:32
A base class used to implement the common part between GmBoundaryCondition and GmContactBoundaryCondi...
Definition: gmBoundaryCondition.h:56
QStringList _propertyMaterialIds
The ids of the property values.
Definition: gmContactBoundaryCondition.h:77
virtual void printExtraHeaderInfo(const GmLogCategory &logger, GmLogLevel level) const
Aux function to print(), giving a chance for derived classes to add additional header data.
Definition: gmBoundaryCondition.h:207
Interface class for accessing and setting values from an "indexable" collection of values.
Definition: gmValueAccessor.h:59
bool isGlobal() const
Returns whether this table stores global or local boundary conditions.
Definition: gmContactBoundaryCondition.h:43
GmContactBoundaryCondition(QString id, QString description, QString type, GmMesh *mesh, BcType bcType)
Constructor. See parameter description on the GmBoundaryConditionBase constructor documentation.
Definition: gmContactBoundaryCondition.h:36
int numPropertyValues() const
Returns the number o property values.
Definition: gmContactBoundaryCondition.h:46
Auxiliar class used to store the complete set of simulation data.
Definition: gmSimulationData.h:51
BcType
Boundary condition type defining where a BC is applied (node, edge or face)
Definition: gmBoundaryCondition.h:60
QVector< QMap< int, int > > _materialMap
Given a material index (recovered from the material column of the application point table),...
Definition: gmContactBoundaryCondition.h:87
Declaration of the GmBoundaryCondition class.
virtual QString msgPrefix() const
The contents of the %1 argument on the "%1boundary condition" string used on error messages.
Definition: gmContactBoundaryCondition.h:65
virtual void printExtraPropertyValues(const GmLogCategory &logger, GmLogLevel level) const
Aux function to print(), giving a chance for derived classes to add property values when _appPointUse...
Definition: gmBoundaryCondition.h:210
bool _global
Is this a global or a local contact BC?
Definition: gmContactBoundaryCondition.h:74
QStringList _materialList
The material list data.
Definition: gmContactBoundaryCondition.h:75
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
The GmContactBoundaryConditionAccessor class is a proxy object to a value accesor implementing a more...
Definition: gmContactBoundaryConditionAccessor.h:34
GmLogLevel
Available log levels list.
Definition: gmLog.h:36
Class representing a category with multiple logging levels.
Definition: gmLog.h:58
GmValueAccessor * _materialAc
The accessor for the column storing the material index associated with each BC.
Definition: gmContactBoundaryCondition.h:76
const QStringList & materialList() const
Returns the contact material list.
Definition: gmContactBoundaryCondition.h:52
Base interface class for Mesh type plugins.
Definition: gmMesh.h:44