TexGen
Materials.h
Go to the documentation of this file.
1/*=============================================================================
2TexGen: Geometric textile modeller.
3Copyright (C) 2017 Louise Brown
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18=============================================================================*/
19#pragma once
20
21namespace TexGen
22{
23 using namespace std;
24
25 class CTextile;
26
29 {
30 public:
31 virtual CMaterial* Copy() const = 0;
32 virtual string GetAbaqusCommands(string Type = "" ) = 0;
33 virtual vector<double>& GetConstants() = 0;
34 virtual string GetThermAbaqusCommands(string Type = "") { return ""; }
35 };
36
39 {
40 public:
41 CUMAT() {}
42 CUMAT(const vector<double> &Constants){ m_Constants = Constants; }
43 CMaterial* Copy() const { return new CUMAT(*this); }
44 string GetAbaqusCommands(string Type = "");
45 string GetThermAbaqusCommands(string Type = "");
46 void SetConstants(vector<double> Constants) { m_Constants = Constants; }
47 vector<double>& GetConstants() { return m_Constants; }
48
49 protected:
50 vector<double> m_Constants;
51 };
52
54 {
55 public:
58
60 void SetupMaterials( CTextile& Textile );
62 void AssignMaterial(string Material, int iYarn);
64 void AssignMaterial(string Material, const vector<int> &Yarns);
66 bool CompareMaterialConstants( const vector<double> &MatConstants, const vector<double> &ThermConstants, const pair< vector<double>, vector<double> > &Constants );
68 void AddMaterial(string Name, const pair<vector<double>, vector<double> > &Constants);
70 bool CheckYarnConstants( pair< vector<double>, vector<double> > &Constants );
71
73 void OutputMaterials( ostream &Output, int iNumYarns, bool bMatrixOnly );
74
75 map<string, pair< CObjectContainer<CMaterial>, CObjectContainer<CMaterial> > > GetMaterials() { return m_Materials; }
76 map<int, string> GetMaterialAssignements() { return m_MaterialAssignements; }
77 protected:
79 //void OutputMaterials(ostream &Output, int iNumYarns, bool bMatrixOnly );
80 map<int, string> m_MaterialAssignements;
81 map<string, pair< CObjectContainer<CMaterial>, CObjectContainer<CMaterial> > > m_Materials;
82 };
83
84}; // namespace TexGen
#define CLASS_DECLSPEC
Definition: Misc.h:35
Abstract base class to represent a material definition.
Definition: Materials.h:29
virtual vector< double > & GetConstants()=0
virtual string GetAbaqusCommands(string Type="")=0
virtual string GetThermAbaqusCommands(string Type="")
Definition: Materials.h:34
virtual CMaterial * Copy() const =0
Object container to help handle memory management issues.
Represents a textile cell containing yarns.
Definition: Textile.h:39
map< string, pair< CObjectContainer< CMaterial >, CObjectContainer< CMaterial > > > m_Materials
Definition: Materials.h:81
map< int, string > m_MaterialAssignements
Output materials and assign to yarn element sets.
Definition: Materials.h:80
map< string, pair< CObjectContainer< CMaterial >, CObjectContainer< CMaterial > > > GetMaterials()
Definition: Materials.h:75
map< int, string > GetMaterialAssignements()
Definition: Materials.h:76
Represents a UMAT material definition.
Definition: Materials.h:39
void SetConstants(vector< double > Constants)
Definition: Materials.h:46
vector< double > & GetConstants()
Definition: Materials.h:47
CMaterial * Copy() const
Definition: Materials.h:43
vector< double > m_Constants
Definition: Materials.h:50
CUMAT(const vector< double > &Constants)
Definition: Materials.h:42
Namespace containing a series of customised math operations not found in the standard c++ library.