OOFEM 3.0
Loading...
Searching...
No Matches
latticecrosssection.C
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#include "latticecrosssection.h"
38#include "gausspoint.h"
39#include "element.h"
40#include "floatarray.h"
41#include "floatarrayf.h"
42#include "floatmatrixf.h"
43
44namespace oofem {
46
48LatticeCrossSection :: giveLatticeMaterial() const
49{
50 return static_cast< LatticeStructuralMaterial * >( this->giveDomain()->giveMaterial(this->materialNum) );
51}
52
53int
54LatticeCrossSection :: checkConsistency()
55{
56 // Checks if the given cross section material is a 'LatticeStructuralMaterial'
57 Material *mat = this->giveDomain()->giveMaterial(this->materialNum);
58 if ( !dynamic_cast< LatticeStructuralMaterial * >( mat ) ) {
59 OOFEM_WARNING("material %s is not a structural interface material", mat->giveClassName() );
60 return 0;
61 }
62
63 return 1;
64}
65
66void
67LatticeCrossSection :: initializeFrom(InputRecord &ir)
68{
69 CrossSection :: initializeFrom(ir);
71
72 double thickness = 0.0;
75 propertyDictionary.add(CS_Thickness, thickness);
76 }
77}
78
79double LatticeCrossSection :: giveLatticeStress1d(double strain, GaussPoint *gp, TimeStep *tStep) const
80{
81 return this->giveLatticeMaterial()->giveLatticeStress1d(strain, gp, tStep);
82}
83
84FloatArrayF< 3 >LatticeCrossSection :: giveLatticeStress2d(const FloatArrayF< 3 > &strain, GaussPoint *gp, TimeStep *tStep) const
85{
86 return this->giveLatticeMaterial()->giveLatticeStress2d(strain, gp, tStep);
87}
88
89FloatArrayF< 6 >LatticeCrossSection :: giveLatticeStress3d(const FloatArrayF< 6 > &strain, GaussPoint *gp, TimeStep *tStep) const
90{
91 return this->giveLatticeMaterial()->giveLatticeStress3d(strain, gp, tStep);
92}
93
94
95
97LatticeCrossSection :: give1dStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
98{
100 if ( mat->hasAnalyticalTangentStiffness() ) {
101 return mat->give1dLatticeStiffnessMatrix(rMode, gp, tStep);
102 } else {
103 OOFEM_ERROR("not implemented");
104 }
105}
106
108LatticeCrossSection :: give2dStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
109{
111 if ( mat->hasAnalyticalTangentStiffness() ) {
112 return mat->give2dLatticeStiffnessMatrix(rMode, gp, tStep);
113 } else {
114 OOFEM_ERROR("not implemented");
115 }
116}
117
119LatticeCrossSection :: give3dStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
120{
122 if ( mat->hasAnalyticalTangentStiffness() ) {
123 return mat->give3dLatticeStiffnessMatrix(rMode, gp, tStep);
124 } else {
125 OOFEM_ERROR("not implemented");
126 }
127}
128
129
130int
131LatticeCrossSection :: giveIPValue(FloatArray &answer, GaussPoint *ip, InternalStateType type, TimeStep *tStep)
132{
133 if ( type == IST_CrossSectionNumber ) {
134 answer.resize(1);
135 answer.at(1) = this->giveNumber();
136 return 1;
137 }
138 return this->giveLatticeMaterial()->giveIPValue(answer, ip, type, tStep);
139}
140
141double
142LatticeCrossSection :: give(int aProperty, GaussPoint *gp) const
143{
144 return this->giveMaterial(gp)->give(aProperty, gp);
145}
146
147Material *LatticeCrossSection :: giveMaterial(IntegrationPoint *ip) const
148{
149 if ( this->giveMaterialNumber() ) {
150 return this->giveDomain()->giveMaterial(this->giveMaterialNumber() );
151 } else {
152 return ip->giveElement()->giveMaterial();
153 }
154}
155
156
157int
158LatticeCrossSection :: packUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *gp)
159{
160 return this->giveLatticeMaterial()->packUnknowns(buff, tStep, gp);
161}
162
163int
164LatticeCrossSection :: unpackAndUpdateUnknowns(DataStream &buff, TimeStep *tStep, GaussPoint *gp)
165{
166 return this->giveLatticeMaterial()->unpackAndUpdateUnknowns(buff, tStep, gp);
167}
168
169int
170LatticeCrossSection :: estimatePackSize(DataStream &buff, GaussPoint *gp)
171{
172 return this->giveLatticeMaterial()->estimatePackSize(buff, gp);
173}
174} // end namespace oofem
#define REGISTER_CrossSection(class)
Dictionary propertyDictionary
virtual Material * giveMaterial()
Definition element.C:523
Domain * giveDomain() const
Definition femcmpnn.h:97
virtual const char * giveClassName() const =0
int giveNumber() const
Definition femcmpnn.h:104
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
Element * giveElement()
Returns corresponding element to receiver.
Definition gausspoint.h:187
virtual bool hasField(InputFieldType id)=0
Returns true if record contains field identified by idString keyword.
Material * giveMaterial(IntegrationPoint *ip) const override
hidden by virtual oofem::Material* TransportCrossSection::giveMaterial() const
LatticeStructuralMaterial * giveLatticeMaterial() const
virtual FloatMatrixF< 6, 6 > give3dLatticeStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
virtual FloatMatrixF< 1, 1 > give1dLatticeStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
virtual FloatMatrixF< 3, 3 > give2dLatticeStiffnessMatrix(MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep) const
#define OOFEM_WARNING(...)
Definition error.h:80
#define OOFEM_ERROR(...)
Definition error.h:79
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Definition inputrecord.h:75
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_LatticeCrossSection_thickness
#define _IFT_LatticeCrossSection_Material
@ CS_Thickness
Thickness.
GaussPoint IntegrationPoint
Definition gausspoint.h:272

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011