OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
structuralinterfacematerialstatus.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 - 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 
37 #include "contextioerr.h"
38 
39 #include "../sm/Materials/structuralmaterial.h"
41 #include "gausspoint.h"
42 namespace oofem {
44  MaterialStatus(n, d, g), jump(3), traction(3), tempTraction(3), tempJump(3), firstPKTraction(3), tempFirstPKTraction(3), F(3, 3), tempF(3, 3),
45  mNewlyInserted(true)
46 {
47  this->F.beUnitMatrix();
48  this->tempF.beUnitMatrix();
49 }
50 
51 
53 
54 
56 {
57 #if 1
59 
60  fprintf(file, " jump ");
61  for ( auto &val : this->jump ) {
62  fprintf(file, " %.4e", val );
63  }
64 
65  fprintf(file, "\n traction ");
66  for ( auto &val : this->traction ) {
67  fprintf(file, " %.4e", val );
68  }
69  fprintf(file, "\n");
70 #endif
71 }
72 
73 
75 // Performs end-of-step updates.
76 {
78 
79  this->jump = this->tempJump;
80  this->traction = this->tempTraction;
82  this->F = this->tempF;
83 }
84 
85 
87 //
88 // initialize record at the begining of new load step
89 //
90 {
92 
93  // see if vectors describing reached equilibrium are defined
94  if ( this->giveJump().giveSize() == 0 ) {
95 
96  this->jump.resize( this->giveDomain()->giveNumberOfSpatialDimensions() );
97  //this->jump.resize(3);
98  this->jump.zero();
99  }
100 
101  if ( this->giveTraction().giveSize() == 0 ) {
102  this->traction.resize( this->giveDomain()->giveNumberOfSpatialDimensions() );
103  //this->traction.resize(3);
104  this->traction.zero();
105  }
106 
107  // reset temp vars.
108  this->tempJump = this->jump;
109  this->tempTraction = this->traction;
110  this->tempFirstPKTraction = this->firstPKTraction;
111  this->tempF = this->F;
112 }
113 
114 
117 {
118 #if 0
119  contextIOResultType iores;
120 
121  if ( ( iores = MaterialStatus :: saveContext(stream, mode, obj) ) != CIO_OK ) {
122  THROW_CIOERR(iores);
123  }
124 
125  if ( ( iores = strainVector.storeYourself(stream) ) != CIO_OK ) {
126  THROW_CIOERR(iores);
127  }
128 
129  if ( ( iores = stressVector.storeYourself(stream) ) != CIO_OK ) {
130  THROW_CIOERR(iores);
131  }
132 #endif
133  return CIO_OK;
134 }
135 
136 
139 {
140 #if 0
141  contextIOResultType iores;
142 
143  if ( ( iores = MaterialStatus :: restoreContext(stream, mode, obj) ) != CIO_OK ) {
144  THROW_CIOERR(iores);
145  }
146 
147  if ( ( iores = strainVector.restoreYourself(stream) ) != CIO_OK ) {
148  THROW_CIOERR(iores);
149  }
150 
151  if ( ( iores = stressVector.restoreYourself(stream) ) != CIO_OK ) {
152  THROW_CIOERR(iores);
153  }
154 #endif
155  return CIO_OK;
156 }
157 
159 {
160  MaterialStatus &tmpStat = const_cast< MaterialStatus & >(iStatus);
161  const StructuralInterfaceMaterialStatus &structStatus = dynamic_cast< StructuralInterfaceMaterialStatus & >(tmpStat);
162 
163  jump = structStatus.giveJump();
164  traction = structStatus.giveTraction();
165  tempTraction = structStatus.giveTempTraction();
166  tempJump = structStatus.giveTempJump();
167  firstPKTraction = structStatus.giveFirstPKTraction();
169  F = structStatus.giveF();
170  tempF = structStatus.giveTempF();
171  mNormalDir = structStatus.giveNormal();
172 }
173 
174 
176 {
177  OOFEM_ERROR("not implemented");
178 }
179 } // end namespace oofem
FloatArray tempJump
Temporary jump (discontinuity)
virtual void updateYourself(TimeStep *)
Update equilibrium history variables according to temp-variables.
Definition: matstatus.h:108
FloatMatrix tempF
Temporary deformation gradient in reduced form (to find balanced state)
FloatArray traction
Equilibrated (engineering) traction vector.
Class and object Domain.
Definition: domain.h:115
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
Definition: datastream.h:54
const FloatArray & giveTempTraction() const
Returns the const pointer to receiver&#39;s temporary traction vector.
virtual void copyStateVariables(const MaterialStatus &iStatus)
Functions for MaterialStatusMapperInterface.
const FloatArray & giveFirstPKTraction() const
Returns the const pointer to receiver&#39;s first Piola-Kirchhoff traction vector.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
Definition: femcmpnn.C:51
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
#define THROW_CIOERR(e)
Definition: contextioerr.h:61
virtual void updateYourself(TimeStep *tStep)
Update equilibrium history variables according to temp-variables.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
Definition: matstatus.h:103
#define OOFEM_ERROR(...)
Definition: error.h:61
const FloatMatrix & giveTempF() const
Returns the const pointer to receiver&#39;s temporary deformation gradient vector.
FloatMatrix F
Equilibrated deformation gradient in reduced form.
FloatArray tempFirstPKTraction
Temporary first Piola-Kirchhoff traction vector (to find balanced state)
This class implements a structural interface material status information.
const FloatArray & giveJump() const
Returns the const pointer to receiver&#39;s jump.
FloatArray jump
Equilibrated jump (discontinuity)
Abstract base class representing a material status information.
Definition: matstatus.h:84
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
const FloatArray & giveTraction() const
Returns the const pointer to receiver&#39;s traction vector.
FloatArray firstPKTraction
Equilibrated first Piola-Kirchhoff traction vector T.
StructuralInterfaceMaterialStatus(int n, Domain *d, GaussPoint *g)
Constructor. Creates new StructuralInterfaceMaterialStatus with number n, belonging to domain d and I...
virtual void addStateVariables(const MaterialStatus &iStatus)
FloatArray mNormalDir
Interface normal direction.
void zero()
Zeroes all coefficients of receiver.
Definition: floatarray.C:658
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Stores receiver state to output stream.
const FloatArray & giveTempFirstPKTraction() const
Returns the const pointer to receiver&#39;s temporary first Piola-Kirchhoff traction vector.
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
Definition: contextmode.h:43
FloatArray tempTraction
Temporary (engineering) traction vector.
Domain * giveDomain() const
Definition: femcmpnn.h:100
void beUnitMatrix()
Sets receiver to unity matrix.
Definition: floatmatrix.C:1332
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode, void *obj=NULL)
Restores the receiver state previously written in stream.
Definition: femcmpnn.C:64
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Print receiver&#39;s output to given stream.
Definition: matstatus.h:97
const FloatArray & giveTempJump() const
Returns the const pointer to receiver&#39;s temporary jump.
virtual void initTempStatus()
Initializes the temporary internal variables, describing the current state according to previously re...
const FloatMatrix & giveF() const
Returns the const pointer to receiver&#39;s deformation gradient vector.
const FloatArray & giveNormal() const
Returns const reference to normal vector.
Class representing integration point in finite element program.
Definition: gausspoint.h:93
Class representing solution step.
Definition: timestep.h:80
void resize(int s)
Resizes receiver towards requested size.
Definition: floatarray.C:631

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