GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmStateVar.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
23#ifndef _GEMA_STATE_VAR_H_
24#define _GEMA_STATE_VAR_H_
25
26#include "gmCoreConfig.h"
27#include "gmValueInfo.h"
28
29#include <QString>
30#include <unit.h>
31
41{
42public:
45
47 const GmValueInfo* info() const { return _info; }
48
50 GmValueInfo* info() { return _info; }
51
53 QString id() const { return _info->id(); }
54
56 QString description() const { return _info->description(); }
57
59 bool isNodeBased() const { return _info->kind() == GM_NODE_STATEVAR; }
60
62 bool isCellBased() const { return _info->kind() == GM_CELL_STATEVAR; }
63
65 Unit unit() const { return _info->unit(); }
66
72 int dim() const { return _info->size(); }
73
78 int isScalar() const { return _info->isScalar(); }
79
81 int baseDof() const { return _dof; }
82
84 int groupId() const { return _groupId; }
85
87 QString groupName() const { return _groupName; }
88
90 void setBaseDof(int dof) { _dof = dof; }
91
93 void setGroupId(QString name, int groupId) { _groupName = name, _groupId = groupId; }
94
96 void setGroupId(int groupId) { _groupId = groupId; }
97
102 void setGroupName(QString name) { _groupName = name; }
103
104private:
105
107 int _dof;
110};
111
112
113#endif
114
115
Auxiliar class used to store the definition of a state variable.
Definition gmStateVar.h:41
int baseDof() const
Returns the base degree of freedom associated to this state variable.
Definition gmStateVar.h:81
bool isCellBased() const
Returns true if this is a cell based state variable.
Definition gmStateVar.h:62
void setGroupId(int groupId)
Sets the state var group id. Should not be used by general code, only by the ModelData class.
Definition gmStateVar.h:96
GmValueInfo * info()
Returns the info object associated to this state variable.
Definition gmStateVar.h:50
void setGroupId(QString name, int groupId)
Sets the state var group name and id.
Definition gmStateVar.h:93
const GmValueInfo * info() const
Returns the info object associated to this state variable.
Definition gmStateVar.h:47
void setBaseDof(int dof)
Sets the base degree of freedom associated with this state variable.
Definition gmStateVar.h:90
QString groupName() const
Returns the state variable group name.
Definition gmStateVar.h:87
int groupId() const
Returns the state variable group id.
Definition gmStateVar.h:84
QString id() const
Returns the state variable id.
Definition gmStateVar.h:53
int dim() const
Returns the number of dimensions for the state var.
Definition gmStateVar.h:72
int _dof
The base degree of freedom (dof) number associated to this state variable.
Definition gmStateVar.h:107
int _groupId
Group identifier allowing several state vars to be treated equally, for example, when applying calcul...
Definition gmStateVar.h:108
Unit unit() const
Returns the unit in which values of the state variable are expressed.
Definition gmStateVar.h:65
GmValueInfo * _info
State var information.
Definition gmStateVar.h:106
bool isNodeBased() const
Returns true if this is a node based state variable.
Definition gmStateVar.h:59
int isScalar() const
Returns true if the state var is scalar. Notice that being a scalar cant be inferred by dim() == 1 si...
Definition gmStateVar.h:78
void setGroupName(QString name)
Sets the state var group name. Should be used only before the state var has been added to the model....
Definition gmStateVar.h:102
QString description() const
Returns the state variable description.
Definition gmStateVar.h:56
QString _groupName
Group name.
Definition gmStateVar.h:109
Auxiliar class used to store the definition of a value. It can be used to store informations about st...
Definition gmValueInfo.h:132
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of the GmValueInfo class.
@ GM_NODE_STATEVAR
This value set stores state variables attached to nodes.
Definition gmValueInfo.h:40
@ GM_CELL_STATEVAR
This value set stores state variables attached to cells.
Definition gmValueInfo.h:42