OOFEM 3.0
Loading...
Searching...
No Matches
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 - 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
35
37#include "timestep.h"
38#include "classfactory.h"
39#include "floatmatrix.h"
42#include "domain.h"
43#include "dof.h"
44#include "mathfem.h"
45#include "paramkey.h"
46
47
48namespace oofem {
50
51ParamKey InteractionPFEMParticle::IPK_InteractionPFEMParticle_coupledNode("couplednode");
55InteractionPFEMParticle :: InteractionPFEMParticle(int n, Domain *aDomain) : PFEMParticle(n, aDomain), coupledNode(0)
56{ }
57//from hanging node
58
62void
63InteractionPFEMParticle :: initializeFrom(InputRecord &ir, int priority)
64{
65 PFEMParticle :: initializeFrom(ir, priority);
66 ParameterManager &ppm = this->giveDomain()->dofmanPPM;
68}
69
73int
74InteractionPFEMParticle :: checkConsistency()
75{
76 return PFEMParticle :: checkConsistency();
77}
78
79void
80InteractionPFEMParticle :: updateYourself(TimeStep *tStep)
81{
82 PFEMParticle :: updateYourself(tStep);
83}
84
85void
86InteractionPFEMParticle :: givePrescribedUnknownVector(FloatArray &answer, const IntArray &dofIDArry,
87 ValueModeType mode, TimeStep *stepN)
88{
89 answer.resize( dofIDArry.giveSize() );
90
91
92 FloatArray velocities;
94 if (fsiProblem) {
95 StructuralEngngModel *structuralProblem = this->giveStructuralProblem();
96 if ( structuralProblem ) {
97 int j = 1;
98 if (fsiProblem->giveIterationNumber() < 1) {
99 for (int dofid: dofIDArry ) {
100 answer.at(j++) = this->giveDofWithID( dofid )->giveBcValue(mode, stepN);
101 }
102 } else {
103 DofManager *dman = structuralProblem->giveDomain(1)->giveDofManager(coupledNode);
104 //dman->giveUnknownVectorOfType(velocities, VelocityVector, VM_Velocity, stepN);
105 //dman->giveUnknownVector(velocities, dofIDArry, VM_Velocity, stepN);
106 dman->giveCompleteUnknownVector(velocities, VM_Velocity, stepN);
107 for ( int dofid: dofIDArry) {
108 answer.at(dofid) = velocities.at( dofid );
109 }
110 }
111 }
112 }
113
114 // Transform to global c.s.
115 FloatMatrix L2G;
116 if (this->computeL2GTransformation(L2G, dofIDArry)) {
117 answer.rotatedWith(L2G, 'n');
118 }
119}
120
121void
123{
124 StructuralEngngModel* structuralProblem = this->giveStructuralProblem();
125 if ( structuralProblem ) {
126 DofManager *dman = structuralProblem->giveDomain(1)->giveDofManager(coupledNode);
127 dman->giveCompleteUnknownVector(answer, VM_Velocity, stepN);
128 }
129}
130
131#ifdef __OOFEG
132void InteractionPFEMParticle :: drawScalar(oofegGraphicContext &gc)
133{
134 PFEMParticle :: drawScalar(gc);
135}
136#endif
137
139InteractionPFEMParticle :: giveStructuralProblem()
140{
141 StructuralEngngModel *structuralProblem = NULL;
143 if (fsiProblem)
144 {
145 for ( int i = 1; i <= fsiProblem->giveNumberOfSlaveProblems(); i++ ) {
146 structuralProblem = dynamic_cast<StructuralEngngModel*>(fsiProblem->giveSlaveProblem(i));
147 }
148 }
149 return structuralProblem;
150}
151
153InteractionPFEMParticle :: giveFluidStructureMasterProblem()
154{
155 FluidStructureProblem *fsiProblem = dynamic_cast<FluidStructureProblem*>(domain->giveEngngModel()->giveMasterEngngModel());
156
157 return fsiProblem;
158}
159} // end namespace oofem
#define REGISTER_DofManager(class)
Dof * giveDofWithID(int dofID) const
Definition dofmanager.C:127
void giveCompleteUnknownVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep)
Definition dofmanager.C:709
DofManager * giveDofManager(int n)
Definition domain.C:317
Domain * giveDomain(int n)
Definition engngm.C:1936
Domain * giveDomain() const
Definition femcmpnn.h:97
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
int number
Component number.
Definition femcmpnn.h:77
void resize(Index s)
Definition floatarray.C:94
double & at(Index i)
Definition floatarray.h:202
void rotatedWith(FloatMatrix &r, char mode)
Definition floatarray.C:814
int giveNumberOfSlaveProblems() override
Returns number of slave problems.
int giveSize() const
Definition intarray.h:211
void giveCoupledVelocities(FloatArray &answer, TimeStep *stepN)
FluidStructureProblem * giveFluidStructureMasterProblem()
static ParamKey IPK_InteractionPFEMParticle_CoupledNode
StructuralEngngModel * giveStructuralProblem()
bool computeL2GTransformation(FloatMatrix &answer, const IntArray &dofIDArry) override
Definition node.C:412
PFEMParticle(int n, Domain *aDomain)
EngngModel * giveSlaveProblem(int i) override
Returns i-th slave problem.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)

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