OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
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 - 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 
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 
45 namespace oofem {
46 REGISTER_DofManager(PFEMParticle);
50  PFEMParticle :: PFEMParticle(int n, Domain *aDomain) : Node(n, aDomain), freeFlag(true), alphaShapeFlag(false), activeFlag(true)
51 { }
52 
58 {
59  return Node :: initializeFrom(ir);
60 }
61 
65 int
67 {
68  int result = 1;
69 
70  result = result && Node :: checkConsistency();
71 
72  return result;
73 }
74 
75 void
77 {
78  // TODO the implementation of free particle movement should be to updateYourself(),
79  // now it is in pfem::solveYourselfAt()
81 }
82 
83 void
85 {
86  DofManager :: printOutputAt(stream, stepN);
87 }
88 
89 #ifdef __OOFEG
91 {
92  GraphicObj *go;
94  if ( gc.giveIntVarType() == IST_Pressure ) {
95  WCRec p [ 1 ]; /* point */
96  p [ 0 ].x = ( FPNum ) this->giveCoordinate(1);
97  p [ 0 ].y = ( FPNum ) this->giveCoordinate(2);
98  p [ 0 ].z = ( FPNum ) this->giveCoordinate(3);
99 
100  int dofindx;
101  double pressVal;
102  if ( ( dofindx = this->findDofWithDofId(P_f) ) ) {
103  pressVal = this->giveDof(dofindx)->giveUnknown(VM_Total, tStep);
104  }
105 
106  EASValsSetLayer(OOFEG_VARPLOT_PATTERN_LAYER);
107  EASValsSetColor( ColorFringeRangeToColor( ColorFringeValueToRange(gc.getFringeTable(), pressVal) ) );
108  EASValsSetMType(FILLED_CIRCLE_MARKER);
109 
110  EASValsSetMSize(8);
111  go = CreateMarker3D(p);
112  EGWithMaskChangeAttributes(COLOR_MASK | LAYER_MASK | MTYPE_MASK | MSIZE_MASK, go);
113  EMAddGraphicsToModel(ESIModel(), go);
114  }
115 }
116 #endif
117 } // end namespace oofem
PFEMParticle(int n, Domain *aDomain)
Constructor.
Definition: pfemparticle.C:50
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
virtual int checkConsistency()
Allows programmer to test some internal data, before computation begins.
Definition: node.C:325
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
EngngModel * giveEngngModel()
Returns engineering model to which receiver is associated.
Definition: domain.C:433
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to stream, for given time step.
Definition: dofmanager.C:510
virtual double giveCoordinate(int i)
Definition: node.C:82
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
Definition: node.C:93
InternalStateType giveIntVarType()
virtual void updateYourself(TimeStep *tStep)
Updates receiver at end of time step (i.e.
Definition: node.C:222
REGISTER_DofManager(ElementSide)
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
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
std::vector< Dof * >::const_iterator findDofWithDofId(DofIDItem dofID) const
Finds index of DOF with required physical meaning of receiver.
Definition: dofmanager.C:266
virtual void printOutputAt(FILE *stream, TimeStep *stepN)
Prints output of receiver to stream, for given time step.
Definition: pfemparticle.C:84
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
Definition: engngm.h:683
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
Class implementing node in finite element mesh.
Definition: node.h:87
#define OOFEG_VARPLOT_PATTERN_LAYER
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:30 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011