OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
isomoisturemat.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 #include "isomoisturemat.h"
36 #include "floatmatrix.h"
37 #include "gausspoint.h"
38 
39 namespace oofem {
42 {
43  return Material :: initializeFrom(ir);
44 }
45 
46 void
48 {
49  TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
50 
52  answer.beScaled(-this->givePermeability(gp, tStep), grad);
53 
54  ms->setTempField(field);
55  ms->setTempGradient(grad);
56  ms->setTempFlux(answer);
57 }
58 
59 void
61  MatResponseMode mode,
62  GaussPoint *gp,
63  TimeStep *tStep)
64 {
65  /*
66  * returns constitutive (conductivity) matrix of receiver
67  */
68 
69  double permeability;
70  permeability = this->givePermeability(gp, tStep);
71 
72  MaterialMode mMode = gp->giveMaterialMode();
73  switch ( mMode ) {
74  case _1dHeat:
75  answer.resize(1, 1);
76  answer.at(1, 1) = permeability;
77  case _2dHeat:
78  answer.resize(2, 2);
79  answer.at(1, 1) = permeability;
80  answer.at(2, 2) = permeability;
81  return;
82 
83  case _3dHeat:
84  answer.resize(3, 3);
85  answer.at(1, 1) = permeability;
86  answer.at(2, 2) = permeability;
87  answer.at(3, 3) = permeability;
88  return;
89 
90  default:
91  OOFEM_ERROR("unknown mode (%s)", __MaterialModeToString(mMode) );
92  }
93 
94  return;
95 }
96 
97 
98 double
100  GaussPoint *gp,
101  TimeStep *tStep)
102 {
103  if ( mode == Capacity ) {
104  return this->giveMoistureCapacity(gp, tStep);
105  } else {
106  OOFEM_ERROR("unknown mode (%s)", __MatResponseModeToString(mode) );
107  }
108 
109  return 0.;
110 }
111 
112 
113 int
115 {
116  if ( type == IST_HydrationDegree ) {
117  answer.resize(1);
118  answer.at(1) = 0.;
119  return 1;
120  }
121 
122  /* else if ( type == IST_Humidity ) {
123  * FloatArray state = static_cast< TransportMaterialStatus * >( giveStatus(gp) )->giveStateVector();
124  * if ( state.giveSize() < 1 ) {
125  * OOFEM_ERROR("undefined moisture status!");
126  * }
127  *
128  * answer.resize(1);
129  * answer.at(1) = state.at(1);
130  * return 1;
131  * }*/
132 
133  return TransportMaterial :: giveIPValue(answer, gp, type, tStep);
134 }
135 } // end namespace oofem
InternalStateType
Type representing the physical meaning of element or constitutive model internal variable.
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes characteristic matrix of receiver in given integration point.
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
virtual double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the characteristic value of receiver in given integration point, respecting its history...
virtual double giveMoistureCapacity(GaussPoint *gp, TimeStep *tStep)=0
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
const char * __MatResponseModeToString(MatResponseMode _value)
Definition: cltypes.C:326
virtual int giveIPValue(FloatArray &answer, GaussPoint *gp, InternalStateType type, TimeStep *tStep)
Returns the integration point corresponding value in Reduced form.
This class implements a transport material status information.
MaterialMode
Type representing material mode of integration point.
Definition: materialmode.h:89
MatResponseMode
Describes the character of characteristic material matrix.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
Definition: floatarray.C:146
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
virtual void giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)
Returns the flux for the field and its gradient.
#define OOFEM_ERROR(...)
Definition: error.h:61
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void setTempField(FloatArray newField)
Set field.
double at(int i, int j) const
Coefficient access function.
Definition: floatmatrix.h:176
void setTempGradient(FloatArray grad)
Set gradient.
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
void setTempFlux(FloatArray w)
Set flux.
void resize(int rows, int cols)
Checks size of receiver towards requested bounds.
Definition: floatmatrix.C:1358
Class representing the general Input Record.
Definition: inputrecord.h:101
virtual double givePermeability(GaussPoint *gp, TimeStep *tStep)=0
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.
Definition: material.C:89
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:29 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011