OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
prescribedgradientbcweakperiodic.C
Go to the documentation of this file.
1 /*
2  * prescribedgradientbcweakperiodic.C
3  *
4  * Created on: May 19, 2014
5  * Author: svennine
6  */
7 
9 
10 #include "classfactory.h"
11 
12 namespace oofem {
13 REGISTER_BoundaryCondition(PrescribedGradientBCWeakPeriodic);
14 
17 {}
18 
20 
22 {
23  mMeshIsPeriodic = true;
24 
26 }
27 
29 {
30  bool enforceCornerPeriodicity = true;
31  int numSides = 2;
32  clear();
33  createTractionMesh(enforceCornerPeriodicity, numSides);
34 }
35 
37 {
38  FloatArray xMinus;
39  giveMirroredPointOnGammaMinus(xMinus, iPos);
40 
41  oX = {
42  iPos [ 0 ] - xMinus [ 0 ], iPos [ 1 ] - xMinus [ 1 ]
43  };
44 }
45 
46 void PrescribedGradientBCWeakPeriodic :: checkIfCorner(bool &oIsCorner, bool &oDuplicatable, const FloatArray &iPos, const double &iNodeDistTol) const
47 {
48  oIsCorner = false;
49  oDuplicatable = false;
50 
51  FloatArray cornerPos = mLC;
52  if ( iPos.distance(cornerPos) < iNodeDistTol ) {
53  oIsCorner = true;
54  }
55 
56  cornerPos = {
57  mUC [ 0 ], mLC [ 1 ]
58  };
59  if ( iPos.distance(cornerPos) < iNodeDistTol ) {
60  oIsCorner = true;
61  }
62 
63  cornerPos = {
64  mUC [ 0 ], mUC [ 1 ]
65  };
66  if ( iPos.distance(cornerPos) < iNodeDistTol ) {
67  oIsCorner = true;
68  if ( mTractionInterpOrder == 1 ) {
69  oDuplicatable = true;
70  }
71  }
72 
73  cornerPos = {
74  mLC [ 0 ], mUC [ 1 ]
75  };
76  if ( iPos.distance(cornerPos) < iNodeDistTol ) {
77  oIsCorner = true;
78  }
79 }
80 } /* namespace oofem */
bool mMeshIsPeriodic
true -> the traction lives only on gammaPlus, so that we get strong periodicity as a special case...
virtual void postInitialize()
Performs post initialization steps.
REGISTER_BoundaryCondition(BoundaryCondition)
Class and object Domain.
Definition: domain.h:115
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
FloatArray mUC
Upper corner of domain (assuming a rectangular RVE)
int mTractionInterpOrder
Order of interpolation for traction (0->piecewise constant, 1->piecewise linear)
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
Definition: floatarray.C:489
virtual void giveBoundaryCoordVector(FloatArray &oX, const FloatArray &iPos) const
void giveMirroredPointOnGammaMinus(FloatArray &oPosMinus, const FloatArray &iPosPlus) const
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description stored in input record.
void createTractionMesh(bool iEnforceCornerPeriodicity, int iNumSides)
Imposes a prescribed gradient weakly on the boundary with an independent traction discretization...
virtual void checkIfCorner(bool &oIsCorner, bool &oDuplicatable, const FloatArray &iPos, const double &iNodeDistTol) const
Class representing vector of real numbers.
Definition: floatarray.h:82
IRResultType
Type defining the return values of InputRecord reading operations.
Definition: irresulttype.h:47
Class representing the general Input Record.
Definition: inputrecord.h:101
FloatArray mLC
Lower corner of domain (assuming a rectangular RVE)
the oofem namespace is to define a context or scope in which all oofem names are defined.

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