OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
anisomassmat.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 "anisomassmat.h"
36 #include "floatmatrix.h"
37 #include "gausspoint.h"
38 #include "classfactory.h"
39 
40 #include <cstdlib>
41 
42 namespace oofem {
43 REGISTER_Material(AnisotropicMassTransferMaterial);
44 
47 {
48  IRResultType result; // Required by IR_GIVE_FIELD macro
49 
51 #if 0
52  IR_GIVE_FIELD(ir, k, _IFT_AnisotropicMassTransferMaterial_c); // Read permeability matrix c from input file
53 #else
54  FloatArray temp;
55  IR_GIVE_FIELD(ir, temp, _IFT_AnisotropicMassTransferMaterial_c); // Read permeability matrix c from input file
56  k.resize(2, 2);
57  k.at(1, 1) = temp.at(1);
58  k.at(1, 2) = temp.at(2);
59  k.at(2, 1) = temp.at(3);
60  k.at(2, 2) = temp.at(4);
61 #endif
62 
63  return Material :: initializeFrom(ir);
64 }
65 
66 
67 void
69 {
70  TransportMaterialStatus *ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
71 
72  answer.beProductOf(k, grad);
73  answer.negated();
74 
75  ms->setTempField(field);
76  ms->setTempGradient(grad);
77  ms->setTempFlux(answer);
78 }
79 
80 
81 void
83 {
84  MaterialMode mMode = gp->giveMaterialMode();
85  switch ( mMode ) {
86  case _1dHeat:
87  case _2dHeat:
88  case _3dHeat:
89  answer = k;
90  return;
91 
92  default:
93  OOFEM_ERROR("unknown mode (%s)", __MaterialModeToString(mMode) );
94  }
95 }
96 
97 
98 double
100 {
101  OOFEM_ERROR("unknown mode (%s)", __MatResponseModeToString(mode) );
102 
103  return 0.;
104 }
105 } // end namespace oofem
virtual void giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep)
Returns the flux for the field and its gradient.
Definition: anisomassmat.C:68
MaterialMode giveMaterialMode()
Returns corresponding material mode of receiver.
Definition: gausspoint.h:191
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Returns material status of receiver in given integration point.
Definition: material.C:244
FloatMatrix k
Conductivity/permeability matrix. This matrix is read from the input file and should be given row-wis...
Definition: anisomassmat.h:63
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
const char * __MatResponseModeToString(MatResponseMode _value)
Definition: cltypes.C:326
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.
const char * __MaterialModeToString(MaterialMode _value)
Definition: cltypes.C:314
#define OOFEM_ERROR(...)
Definition: error.h:61
#define _IFT_AnisotropicMassTransferMaterial_c
Definition: anisomassmat.h:46
virtual double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes the characteristic value of receiver in given integration point, respecting its history...
Definition: anisomassmat.C:99
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
Receiver becomes the result of the product of aMatrix and anArray.
Definition: floatarray.C:676
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 void giveCharacteristicMatrix(FloatMatrix &answer, MatResponseMode mode, GaussPoint *gp, TimeStep *tStep)
Computes characteristic matrix of receiver in given integration point.
Definition: anisomassmat.C:82
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: anisomassmat.C:46
REGISTER_Material(DummyMaterial)
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define IR_GIVE_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:69
void negated()
Switches the sign of every coefficient of receiver.
Definition: floatarray.C:739
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

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:27 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011