OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
structuralpythonmaterial.h
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 - 2013 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 #ifndef structuralpythonmaterial_h
36 #define structuralpythonmaterial_h
37 
38 #include<boost/python.hpp>
39 namespace bp=boost::python;
40 
41 #include "../sm/Materials/structuralmaterial.h"
42 #include "../sm/Materials/structuralms.h"
43 
44 #if 0
45 #ifndef PyObject_HEAD
46 struct _object;
47 typedef _object PyObject;
48 #endif
49 #endif
50 
52 
53 #define _IFT_StructuralPythonMaterial_Name "structuralpythonmaterial"
54 #define _IFT_StructuralPythonMaterial_moduleName "module"
55 
56 
57 namespace oofem {
76 {
77 private:
79  std :: string moduleName;
81  bp::object module;
84  // callables for large deformations
86 #if 0
90 
94 #endif
95 
97  double pert;
98 public:
100  StructuralPythonMaterial(int n, Domain * d);
102  virtual ~StructuralPythonMaterial();
103 
105  virtual void giveInputRecord(DynamicInputRecord &input);
106 
107  virtual MaterialStatus *CreateStatus(GaussPoint *gp) const;
108 
109  void callStressFunction(bp::object func, const FloatArray &oldStrain, const FloatArray &oldStress, const FloatArray &strain, FloatArray &stress, bp::object stateDict, bp::object tempStateDict, TimeStep *tStep) const;
110  void callTangentFunction(FloatMatrix &answer, bp::object func, const FloatArray &strain, const FloatArray &stress, bp::object stateDict, bp::object tempStateDict, TimeStep *tStep) const;
111 
112  virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer,
113  MatResponseMode mode, GaussPoint *gp, TimeStep *tStep);
114 
115  virtual void give3dMaterialStiffnessMatrix_dPdF(FloatMatrix &answer,
116  MatResponseMode mode,
117  GaussPoint *gp,
118  TimeStep *tStep);
119 
120  virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp,
121  const FloatArray &reducedStrain, TimeStep *tStep);
122 
123  virtual void giveFirstPKStressVector_3d(FloatArray &answer, GaussPoint *gp,
124  const FloatArray &reducedF, TimeStep *tStep);
125 
126  virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep);
127 
128  virtual int hasNonLinearBehaviour() { return true; }
129  virtual const char *giveClassName() const { return "StructuralPythonMaterial"; }
130  virtual const char *giveInputRecordName() const { return _IFT_StructuralPythonMaterial_Name; }
131 };
132 
134 {
135 protected:
137  bp::dict stateDict, tempStateDict;
138 #if 0
139  PyObject *stateDict;
140  PyObject *tempStateDict;
141 #endif
142 
143 public:
148 
149  virtual void initTempStatus();
150  virtual void updateYourself(TimeStep *tStep);
151  void reinitTempStateDictionary();
152 
153  bp::object giveStateDictionary() { return stateDict; }
154  bp::object giveTempStateDictionary() { return tempStateDict; }
155 
156  virtual const char *giveClassName() const { return "StructuralPythonMaterialStatus"; }
157 };
158 } // end namespace oofem
159 #endif // structuralpythonmaterial_h
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
Class and object Domain.
Definition: domain.h:115
_object PyObject
virtual void giveFirstPKStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedF, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
#define _IFT_StructuralPythonMaterial_Name
This class implements a structural material status information.
Definition: structuralms.h:65
bp::object module
module containing functions (created from moduleName)
virtual const char * giveInputRecordName() const
Custom user supplied python scripts for material models.
virtual const char * giveClassName() const
bp::object smallDef
callable for small deformations
MatResponseMode
Describes the character of characteristic material matrix.
StructuralPythonMaterial(int n, Domain *d)
Constructor.
void callTangentFunction(FloatMatrix &answer, bp::object func, const FloatArray &strain, const FloatArray &stress, bp::object stateDict, bp::object tempStateDict, TimeStep *tStep) const
virtual ~StructuralPythonMaterial()
Destructor.
virtual void give3dMaterialStiffnessMatrix_dPdF(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Abstract base class representing a material status information.
Definition: matstatus.h:84
virtual MaterialStatus * CreateStatus(GaussPoint *gp) const
Creates new copy of associated status and inserts it into given integration point.
void callStressFunction(bp::object func, const FloatArray &oldStrain, const FloatArray &oldStress, const FloatArray &strain, FloatArray &stress, bp::object stateDict, bp::object tempStateDict, TimeStep *tStep) const
Class representing vector of real numbers.
Definition: floatarray.h:82
Implementation of matrix containing floating point numbers.
Definition: floatmatrix.h:94
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
virtual void giveRealStressVector_3d(FloatArray &answer, GaussPoint *gp, const FloatArray &reducedStrain, TimeStep *tStep)
Default implementation relies on giveRealStressVector for second Piola-Kirchoff stress.
Class representing the general Input Record.
Definition: inputrecord.h:101
Class representing the a dynamic Input Record.
virtual const char * giveClassName() const
Abstract base class for all "structural" constitutive models.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
std::string moduleName
Name of the file that contains the python function.
virtual void initTempStatus(GaussPoint *gp)
Initializes temporary variables stored in integration point status at the beginning of new time step...
Definition: material.C:267
virtual int hasNonLinearBehaviour()
Returns nonzero if receiver is non linear.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
double pert
Numerical pertubation for numerical tangents.
virtual void give3dMaterialStiffnessMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes full 3d material stiffness matrix at given integration point, time, respecting load history ...
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:31 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011