OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
interactionpfemparticle.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 "timestep.h"
38 #include "classfactory.h"
39 #include "floatmatrix.h"
40 #include "fluidstructureproblem.h"
41 #include "../../sm/EngineeringModels/structengngmodel.h"
42 #include "domain.h"
43 #include "dof.h"
44 #include "mathfem.h"
45 
46 
47 namespace oofem {
48 REGISTER_DofManager(InteractionPFEMParticle);
52 InteractionPFEMParticle :: InteractionPFEMParticle(int n, Domain *aDomain) : PFEMParticle(n, aDomain), coupledNode(0)
53 { }
54 //from hanging node
55 
61 {
62  IRResultType result; // Required by IR_GIVE_FIELD macro
63 
64  result = PFEMParticle :: initializeFrom(ir);
65 
67 
68  return (result != IRRT_OK) ? result : IRRT_OK;
69 }
70 
74 int
76 {
78 }
79 
80 void
82 {
84 }
85 
86 void
88  ValueModeType mode, TimeStep *stepN)
89 {
90  answer.resize( dofIDArry.giveSize() );
91 
92 
93  FloatArray velocities;
95  if (fsiProblem) {
96  StructuralEngngModel *structuralProblem = this->giveStructuralProblem();
97  if ( structuralProblem ) {
98  int j = 1;
99  if (fsiProblem->giveIterationNumber() < 1) {
100  for (int dofid: dofIDArry ) {
101  answer.at(j++) = this->giveDofWithID( dofid )->giveBcValue(mode, stepN);
102  }
103  } else {
104  DofManager *dman = structuralProblem->giveDomain(1)->giveDofManager(coupledNode);
105  //dman->giveUnknownVectorOfType(velocities, VelocityVector, VM_Velocity, stepN);
106  //dman->giveUnknownVector(velocities, dofIDArry, VM_Velocity, stepN);
107  dman->giveCompleteUnknownVector(velocities, VM_Velocity, stepN);
108  for ( int dofid: dofIDArry) {
109  answer.at(dofid) = velocities.at( dofid );
110  }
111  }
112  }
113  }
114 
115  // Transform to global c.s.
116  FloatMatrix L2G;
117  if (this->computeL2GTransformation(L2G, dofIDArry)) {
118  answer.rotatedWith(L2G, 'n');
119  }
120 }
121 
122 void
124 {
125  StructuralEngngModel* structuralProblem = this->giveStructuralProblem();
126  if ( structuralProblem ) {
127  DofManager *dman = structuralProblem->giveDomain(1)->giveDofManager(coupledNode);
128  dman->giveCompleteUnknownVector(answer, VM_Velocity, stepN);
129  }
130 }
131 
132 void
134 {
135  PFEMParticle :: printOutputAt(stream, stepN);
136 }
137 
138 #ifdef __OOFEG
140 {
142 }
143 #endif
144 
147 {
148  StructuralEngngModel *structuralProblem = NULL;
150  if (fsiProblem)
151  {
152  for ( int i = 1; i <= fsiProblem->giveNumberOfSlaveProblems(); i++ ) {
153  structuralProblem = dynamic_cast<StructuralEngngModel*>(fsiProblem->giveSlaveProblem(i));
154  }
155  }
156  return structuralProblem;
157 }
158 
161 {
163 
164  return fsiProblem;
165 }
166 } // end namespace oofem
FluidStructureProblem * giveFluidStructureMasterProblem()
virtual EngngModel * giveSlaveProblem(int i)
Returns i-th slave problem.
Class and object Domain.
Definition: domain.h:115
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition: femcmpnn.h:82
double & at(int i)
Coefficient access function.
Definition: floatarray.h:131
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
Definition: valuemodetype.h:78
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
virtual int checkConsistency()
Checks internal data consistency in node.
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
Base class for dof managers.
Definition: dofmanager.h:113
Class implementing an array of integers.
Definition: intarray.h:61
void rotatedWith(FloatMatrix &r, char mode)
Returns the receiver a rotated according the change-of-base matrix r.
Definition: floatarray.C:799
void giveCoupledVelocities(FloatArray &answer, TimeStep *stepN)
#define _IFT_InteractionPFEMParticle_CoupledNode
REGISTER_DofManager(ElementSide)
virtual void givePrescribedUnknownVector(FloatArray &answer, const IntArray &dofMask, ValueModeType mode, TimeStep *stepN)
virtual void updateYourself(TimeStep *tStep)
Updates receiver at end of time step (i.e.
Definition: pfemparticle.C:76
virtual int checkConsistency()
Checks internal data consistency in node.
Definition: pfemparticle.C:66
Implementation of fluid-structure interaction ) problem based on Dirichlet-Neumann approach...
virtual void printOutputAt(FILE *stream, TimeStep *stepN)
Prints output of receiver to stream, for given time step.
void giveCompleteUnknownVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep)
Assembles the complete unknown vector in node.
Definition: dofmanager.C:737
EngngModel * giveMasterEngngModel()
Returns the master engnmodel.
Definition: engngm.h:516
virtual void drawScalar(oofegGraphicContext &gc)
Class representing vector of real numbers.
Definition: floatarray.h:82
StructuralEngngModel * giveStructuralProblem()
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 IRResultType initializeFrom(InputRecord *ir)
Gets from the source line from the data file all the data of the receiver.
Definition: pfemparticle.C:57
Class representing the general Input Record.
Definition: inputrecord.h:101
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
Definition: dofmanager.C:119
virtual double giveBcValue(ValueModeType mode, TimeStep *tStep)
Returns value of boundary condition of dof if it is prescribed.
Definition: dof.C:120
virtual void printOutputAt(FILE *stream, TimeStep *stepN)
Prints output of receiver to stream, for given time step.
Definition: pfemparticle.C:84
This class implements extension of EngngModel for structural models.
Particle class being used in PFEM computations.
Definition: pfemparticle.h:56
#define IR_GIVE_OPTIONAL_FIELD(__ir, __value, __id)
Macro facilitating the use of input record reading methods.
Definition: inputrecord.h:78
int giveSize() const
Definition: intarray.h:203
virtual bool computeL2GTransformation(FloatMatrix &answer, const IntArray &dofIDArry)
Computes transformation matrix from global c.s.
Definition: node.C:424
InteractionPFEMParticle(int n, Domain *aDomain)
Constructor.
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void drawScalar(oofegGraphicContext &gc)
Definition: pfemparticle.C:90
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Definition: engngm.C:1720
virtual int giveNumberOfSlaveProblems()
Returns number of slave problems.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
Definition: domain.C:314
virtual void updateYourself(TimeStep *tStep)
Updates receiver at end of time step (i.e.
virtual IRResultType initializeFrom(InputRecord *ir)
Gets from the source line from the data file all the data of the receiver.
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