OOFEM 3.0
Loading...
Searching...
No Matches
twophasemat.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
36#include "floatmatrix.h"
37#include "function.h"
38#include "gausspoint.h"
39#include "classfactory.h"
40#include "engngm.h"
41
42namespace oofem {
44
45void
46TwoPhaseMaterial :: initializeFrom(InputRecord &ir)
47{
49 if ( this->slaveMaterial.giveSize() != 2 ) {
50 throw ValueInputException(ir, _IFT_TwoPhaseMaterial_mat, "must have two values");
51 }
52}
53
54
56TwoPhaseMaterial :: computeFlux3D(const FloatArrayF<3> &grad, double field, GaussPoint *gp, TimeStep *tStep) const
57{
58 auto ms = static_cast< TransportMaterialStatus * >( this->giveStatus(gp) );
59 ms->setTempField(field);
60 ms->setTempGradient(grad);
61
62 double vof = this->giveVof(gp, tStep);
63 auto v0 = this->giveMaterial(0)->computeFlux3D(grad, field, gp, tStep);
64 auto v1 = this->giveMaterial(1)->computeFlux3D(grad, field, gp, tStep);
65 auto answer = (1.0 - vof) * v0 + vof * v1;
66 ms->setTempFlux(answer);
67 return answer;
68}
69
70
72TwoPhaseMaterial :: computeTangent3D(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const
73{
74 double vof = this->giveVof(gp, tStep);
75 auto v0 = this->giveMaterial(0)->computeTangent3D(mode, gp, tStep);
76 auto v1 = this->giveMaterial(1)->computeTangent3D(mode, gp, tStep);
77 return (1.0 - vof) * v0 + vof * v1;
78}
79
80double
81TwoPhaseMaterial :: giveCharacteristicValue(MatResponseMode mode,
82 GaussPoint *gp,
83 TimeStep *tStep) const
84{
85 double vof = this->giveVof(gp, tStep);
86 auto v0 = this->giveMaterial(0)->giveCharacteristicValue(mode, gp, tStep);
87 auto v1 = this->giveMaterial(1)->giveCharacteristicValue(mode, gp, tStep);
88 return (1.0 - vof) * v0 + vof * v1;
89}
90
92TwoPhaseMaterial :: giveMaterial(int i) const
93{
94 return static_cast< TransportMaterial * >( domain->giveMaterial( slaveMaterial[i] ) );
95}
96
97double
98TwoPhaseMaterial :: giveVof (GaussPoint* gp, TimeStep* tStep) const
99{
100 return static_cast< TransportElement * >(gp->giveElement()) ->computeVof(tStep);
101}
102
103
104} // end namespace oofem
#define REGISTER_Material(class)
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
Element * giveElement()
Returns corresponding element to receiver.
Definition gausspoint.h:187
virtual MaterialStatus * giveStatus(GaussPoint *gp) const
Definition material.C:206
virtual double computeVof(TimeStep *tStep)
void setTempField(double newField)
Set field.
TransportMaterial(int n, Domain *d)
double giveVof(GaussPoint *gp, TimeStep *tStep) const
Definition twophasemat.C:98
TransportMaterial * giveMaterial(int i) const
Definition twophasemat.C:92
#define IR_GIVE_FIELD(__ir, __value, __id)
Definition inputrecord.h:67
#define _IFT_TwoPhaseMaterial_mat
Definition twophasemat.h:46

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