OOFEM 3.0
Loading...
Searching...
No Matches
prescribedgradientbcweakdirichlet.C
Go to the documentation of this file.
1/*
2 * prescribedgradientbcweakdirichlet.C
3 *
4 * Created on: May 19, 2014
5 * Author: svennine
6 */
7
9
10#include "classfactory.h"
11
12namespace oofem {
14
15PrescribedGradientBCWeakDirichlet :: PrescribedGradientBCWeakDirichlet(int n, Domain *d) :
17{
18 // TODO Auto-generated constructor stub
19}
20
21PrescribedGradientBCWeakDirichlet :: ~PrescribedGradientBCWeakDirichlet()
22{
23 // TODO Auto-generated destructor stub
24}
25
26void PrescribedGradientBCWeakDirichlet :: initializeFrom(InputRecord &ir)
27{
28 PrescribedGradientBCWeak :: initializeFrom(ir);
29 mMeshIsPeriodic = false;
30}
31
32void PrescribedGradientBCWeakDirichlet :: postInitialize()
33{
34 bool enforceCornerPeriodicity = false;
35 int numSides = 4;
36 createTractionMesh(enforceCornerPeriodicity, numSides);
37}
38
39void PrescribedGradientBCWeakDirichlet :: giveBoundaryCoordVector(FloatArray &oX, const FloatArray &iPos) const
40{
41 oX = Vec2(
42 iPos [ 0 ] - mCenterCoord [ 0 ], iPos [ 1 ] - mCenterCoord [ 1 ]
43 );
44}
45
46void PrescribedGradientBCWeakDirichlet :: 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 ( distance(iPos, cornerPos) < iNodeDistTol ) {
53 oIsCorner = true;
54 oDuplicatable = true;
55 }
56
57 cornerPos = Vec2(
58 mUC [ 0 ], mLC [ 1 ]
59 );
60 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
61 oIsCorner = true;
62 oDuplicatable = true;
63 }
64
65 cornerPos = Vec2(
66 mUC [ 0 ], mUC [ 1 ]
67 );
68 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
69 oIsCorner = true;
70 oDuplicatable = true;
71 }
72
73 cornerPos = Vec2(
74 mLC [ 0 ], mUC [ 1 ]
75 );
76 if ( distance(iPos, cornerPos) < iNodeDistTol ) {
77 oIsCorner = true;
78 oDuplicatable = true;
79 }
80}
81} /* namespace oofem */
#define REGISTER_BoundaryCondition(class)
FloatArray mUC
Upper corner of domain (assuming a rectangular RVE).
FloatArray mLC
Lower corner of domain (assuming a rectangular RVE).
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