OOFEM 3.0
Loading...
Searching...
No Matches
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
12namespace oofem {
14
15PrescribedGradientBCWeakPeriodic :: PrescribedGradientBCWeakPeriodic(int n, Domain *d) :
17{}
18
19PrescribedGradientBCWeakPeriodic :: ~PrescribedGradientBCWeakPeriodic() {}
20
21void PrescribedGradientBCWeakPeriodic :: initializeFrom(InputRecord &ir)
22{
23 PrescribedGradientBCWeak :: initializeFrom(ir);
24 mMeshIsPeriodic = true;
25}
26
27void PrescribedGradientBCWeakPeriodic :: postInitialize()
28{
29 bool enforceCornerPeriodicity = true;
30 int numSides = 2;
31 clear();
32 createTractionMesh(enforceCornerPeriodicity, numSides);
33}
34
35void PrescribedGradientBCWeakPeriodic :: giveBoundaryCoordVector(FloatArray &oX, const FloatArray &iPos) const
36{
37 FloatArray xMinus;
39
40 oX = Vec2(
41 iPos [ 0 ] - xMinus [ 0 ], iPos [ 1 ] - xMinus [ 1 ]
42 );
43}
44
45void PrescribedGradientBCWeakPeriodic :: checkIfCorner(bool &oIsCorner, bool &oDuplicatable, const FloatArray &iPos, const double &iNodeDistTol) const
46{
47 oIsCorner = false;
48 oDuplicatable = false;
49
50 FloatArray cornerPos = mLC;
51 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
52 oIsCorner = true;
53 }
54
55 cornerPos = Vec2(
56 mUC [ 0 ], mLC [ 1 ]
57 );
58 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
59 oIsCorner = true;
60 }
61
62 cornerPos = Vec2(
63 mUC [ 0 ], mUC [ 1 ]
64 );
65 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
66 oIsCorner = true;
67 if ( mTractionInterpOrder == 1 ) {
68 oDuplicatable = true;
69 }
70 }
71
72 cornerPos = Vec2(
73 mLC [ 0 ], mUC [ 1 ]
74 );
75 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
76 oIsCorner = true;
77 }
78}
79} /* namespace oofem */
#define REGISTER_BoundaryCondition(class)
void giveMirroredPointOnGammaMinus(FloatArray &oPosMinus, const FloatArray &iPosPlus) const
FloatArray mUC
Upper corner of domain (assuming a rectangular RVE).
FloatArray mLC
Lower corner of domain (assuming a rectangular RVE).
int mTractionInterpOrder
Order of interpolation for traction (0->piecewise constant, 1->piecewise linear).
void createTractionMesh(bool iEnforceCornerPeriodicity, int iNumSides)
static FloatArray Vec2(const double &a, const double &b)
Definition floatarray.h:606
double distance(const FloatArray &x, const FloatArray &y)

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