OOFEM 3.0
Loading...
Searching...
No Matches
pfemparticle.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
36#include "pfemparticle.h"
37#include "timestep.h"
38#include "classfactory.h"
39#include "fmode.h"
40#include "domain.h"
41#include "engngm.h"
42#include "mathfem.h"
43
44
45namespace oofem {
50 PFEMParticle :: PFEMParticle(int n, Domain *aDomain) : Node(n, aDomain), freeFlag(true), alphaShapeFlag(false), activeFlag(true)
51{ }
52
53
57int
58PFEMParticle :: checkConsistency()
59{
60 int result = 1;
61
62 result = result && Node :: checkConsistency();
63
64 return result;
65}
66
67void
68PFEMParticle :: updateYourself(TimeStep *tStep)
69{
70 // TODO the implementation of free particle movement should be to updateYourself(),
71 // now it is in pfem::solveYourselfAt()
72 Node :: updateYourself(tStep);
73}
74
75
76#ifdef __OOFEG
77void PFEMParticle :: drawScalar(oofegGraphicContext &gc)
78{
79 GraphicObj *go;
80 TimeStep *tStep = domain->giveEngngModel()->giveCurrentStep();
81 if ( gc.giveIntVarType() == IST_Pressure ) {
82 WCRec p [ 1 ]; /* point */
83 p [ 0 ].x = ( FPNum ) this->giveCoordinate(1);
84 p [ 0 ].y = ( FPNum ) this->giveCoordinate(2);
85 p [ 0 ].z = ( FPNum ) this->giveCoordinate(3);
86
87 int dofindx;
88 double pressVal;
89 if ( ( dofindx = this->findDofWithDofId(P_f) ) ) {
90 pressVal = this->giveDof(dofindx)->giveUnknown(VM_Total, tStep);
91 }
92
93 EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
94 EASValsSetColor( ColorFringeRangeToColor( ColorFringeValueToRange(gc.getFringeTable(), pressVal) ) );
95 EASValsSetMType(FILLED_CIRCLE_MARKER);
96
97 EASValsSetMSize(8);
98 go = CreateMarker3D(p);
99 EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);
100 EMAddGraphicsToModel(ESIModel(), go);
101 }
102}
103#endif
104} // end namespace oofem
#define REGISTER_DofManager(class)
std::vector< Dof * >::const_iterator findDofWithDofId(DofIDItem dofID) const
Definition dofmanager.C:274
double giveCoordinate(int i) const
Definition dofmanager.h:383
Domain * domain
Link to domain object, useful for communicating with other FEM components.
Definition femcmpnn.h:79
Node(int n, Domain *aDomain)
Definition node.C:73
bool activeFlag
Too close particles can be deactivated, e.g. removed from meshing and computation.
bool freeFlag
The particle does not compose any element, but still a part of solution domain and moves obeying Newt...
bool alphaShapeFlag
the particle is a part of alpha-shape
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
#define OOFEG_VARPLOT_PATTERN_LAYER

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