Skip to content

Commit 49907f7

Browse files
committed
Merge branch 'master' of github.com:jaabell/OpenSees
2 parents 770891c + b47149d commit 49907f7

11 files changed

Lines changed: 167 additions & 74 deletions

File tree

‎DEVELOPER/core/DOF_Group.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,14 +650,14 @@ void
650650
DOF_Group::incrNodeDisp(const Vector &u)
651651
{
652652
if (myNode == 0) {
653-
opserr << "DOF_Group::setNodeDisp: 0 Node Pointer\n";
653+
opserr << "DOF_Group::incrNodeDisp: 0 Node Pointer\n";
654654
exit(-1);
655655
}
656656

657657
Vector &disp = *unbalance;;
658658

659659
if (disp.Size() == 0) {
660-
opserr << "DOF_Group::setNodeIncrDisp - out of space\n";
660+
opserr << "DOF_Group::incrNodeDisp - out of space\n";
661661
return;
662662
}
663663
int i;
@@ -683,7 +683,7 @@ DOF_Group::incrNodeVel(const Vector &udot)
683683
{
684684

685685
if (myNode == 0) {
686-
opserr << "DOF_Group::setNodeVel: 0 Node Pointer\n";
686+
opserr << "DOF_Group::incrNodeVel: 0 Node Pointer\n";
687687
exit(-1);
688688
}
689689

@@ -711,7 +711,7 @@ DOF_Group::incrNodeAccel(const Vector &udotdot)
711711
{
712712

713713
if (myNode == 0) {
714-
opserr << "DOF_Group::setNodeAccel: 0 Node Pointer\n";
714+
opserr << "DOF_Group::incrNodeAccel: 0 Node Pointer\n";
715715
exit(-1);
716716
}
717717

@@ -735,7 +735,7 @@ DOF_Group::setEigenvector(int mode, const Vector &theVector)
735735
{
736736

737737
if (myNode == 0) {
738-
opserr << "DOF_Group::setNodeAccel: 0 Node Pointer\n";
738+
opserr << "DOF_Group::setEigenvector: 0 Node Pointer\n";
739739
exit(-1);
740740
}
741741

@@ -758,7 +758,7 @@ const Matrix &
758758
DOF_Group::getEigenvectors(void)
759759
{
760760
if (myNode == 0) {
761-
opserr << "DOF_Group::setNodeAccel: 0 Node Pointer\n";
761+
opserr << "DOF_Group::getEigenvectors: 0 Node Pointer\n";
762762
exit(-1);
763763
}
764764

‎SRC/analysis/dof_grp/DOF_Group.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -650,14 +650,14 @@ void
650650
DOF_Group::incrNodeDisp(const Vector &u)
651651
{
652652
if (myNode == 0) {
653-
opserr << "DOF_Group::setNodeDisp: 0 Node Pointer\n";
653+
opserr << "DOF_Group::incrNodeDisp: 0 Node Pointer\n";
654654
exit(-1);
655655
}
656656

657657
Vector &disp = *unbalance;;
658658

659659
if (disp.Size() == 0) {
660-
opserr << "DOF_Group::setNodeIncrDisp - out of space\n";
660+
opserr << "DOF_Group::incrNodeDisp - out of space\n";
661661
return;
662662
}
663663
int i;
@@ -683,7 +683,7 @@ DOF_Group::incrNodeVel(const Vector &udot)
683683
{
684684

685685
if (myNode == 0) {
686-
opserr << "DOF_Group::setNodeVel: 0 Node Pointer\n";
686+
opserr << "DOF_Group::incrNodeVel: 0 Node Pointer\n";
687687
exit(-1);
688688
}
689689

@@ -711,7 +711,7 @@ DOF_Group::incrNodeAccel(const Vector &udotdot)
711711
{
712712

713713
if (myNode == 0) {
714-
opserr << "DOF_Group::setNodeAccel: 0 Node Pointer\n";
714+
opserr << "DOF_Group::incrNodeAccel: 0 Node Pointer\n";
715715
exit(-1);
716716
}
717717

@@ -769,7 +769,7 @@ DOF_Group::setEigenvector(int mode, const Vector &theVector)
769769
{
770770

771771
if (myNode == 0) {
772-
opserr << "DOF_Group::setNodeAccel: 0 Node Pointer\n";
772+
opserr << "DOF_Group::setEigenvector: 0 Node Pointer\n";
773773
exit(-1);
774774
}
775775

@@ -792,7 +792,7 @@ const Matrix &
792792
DOF_Group::getEigenvectors(void)
793793
{
794794
if (myNode == 0) {
795-
opserr << "DOF_Group::setNodeAccel: 0 Node Pointer\n";
795+
opserr << "DOF_Group::getEigenvectors: 0 Node Pointer\n";
796796
exit(-1);
797797
}
798798

‎SRC/analysis/dof_grp/LagrangeDOF_Group.cpp‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ LagrangeDOF_Group::incrNodeAccel(const Vector &udotdot)
186186
return;
187187
}
188188

189+
void
190+
LagrangeDOF_Group::setEigenvector(int mode, const Vector &eigenvector)
191+
{
192+
return;
193+
}
189194

190195
const Vector &
191196
LagrangeDOF_Group::getCommittedDisp(void)

‎SRC/analysis/dof_grp/LagrangeDOF_Group.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ class LagrangeDOF_Group: public DOF_Group
7373
virtual void incrNodeVel(const Vector &udot);
7474
virtual void incrNodeAccel(const Vector &udotdot);
7575

76+
virtual void setEigenvector(int mode, const Vector &eigenvector);
77+
7678
virtual void zeroTangent(void);
7779
virtual void addMtoTang(double fact = 1.0);
7880
virtual void zeroUnbalance(void);

‎SRC/element/surfaceLoad/SurfaceLoad.cpp‎

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@
4747
double SurfaceLoad :: oneOverRoot3 = 1.0/sqrt(3.0);
4848
double SurfaceLoad :: GsPts[4][2];
4949

50-
Matrix SurfaceLoad::tangentStiffness(SL_NUM_DOF, SL_NUM_DOF);
51-
Vector SurfaceLoad::internalForces(SL_NUM_DOF);
52-
Vector SurfaceLoad::theVector(SL_NUM_DOF);
50+
Matrix SurfaceLoad::tangentStiffness12(12,12);
51+
Matrix SurfaceLoad::tangentStiffness24(24,24);
52+
Vector SurfaceLoad::internalForces12(12);
53+
Vector SurfaceLoad::internalForces24(24);
5354

5455
#include <elementAPI.h>
5556
static int num_SurfaceLoad = 0;
@@ -100,14 +101,15 @@ OPS_SurfaceLoad(void)
100101
SurfaceLoad::SurfaceLoad(int tag, int Nd1, int Nd2, int Nd3, int Nd4, double pressure)
101102
:Element(tag,ELE_TAG_SurfaceLoad),
102103
myExternalNodes(SL_NUM_NODE),
104+
numDOF(0), theMatrix(0), theVector(0),
103105
g1(SL_NUM_NDF),
104106
g2(SL_NUM_NDF),
105107
myNhat(SL_NUM_NDF),
106108
myNI(SL_NUM_NODE),
107-
dcrd1(SL_NUM_NDF),
108-
dcrd2(SL_NUM_NDF),
109-
dcrd3(SL_NUM_NDF),
110-
dcrd4(SL_NUM_NDF)
109+
dcrd1(3),
110+
dcrd2(3),
111+
dcrd3(3),
112+
dcrd4(3)
111113
{
112114
myExternalNodes(0) = Nd1;
113115
myExternalNodes(1) = Nd2;
@@ -126,19 +128,26 @@ SurfaceLoad::SurfaceLoad(int tag, int Nd1, int Nd2, int Nd3, int Nd4, double pre
126128
my_pressure = pressure;
127129

128130
mLoadFactor = 1.0;
131+
132+
tangentStiffness12.Zero();
133+
tangentStiffness24.Zero();
134+
135+
internalForces12.Zero();
136+
internalForces24.Zero();
129137
}
130138

131139
SurfaceLoad::SurfaceLoad()
132140
:Element(0,ELE_TAG_SurfaceLoad),
133141
myExternalNodes(SL_NUM_NODE),
142+
numDOF(0), theMatrix(0), theVector(0),
134143
g1(SL_NUM_NDF),
135144
g2(SL_NUM_NDF),
136145
myNhat(SL_NUM_NDF),
137146
myNI(SL_NUM_NODE),
138-
dcrd1(SL_NUM_NDF),
139-
dcrd2(SL_NUM_NDF),
140-
dcrd3(SL_NUM_NDF),
141-
dcrd4(SL_NUM_NDF)
147+
dcrd1(3),
148+
dcrd2(3),
149+
dcrd3(3),
150+
dcrd4(3)
142151
{
143152
}
144153

@@ -168,7 +177,7 @@ SurfaceLoad::getNodePtrs(void)
168177
int
169178
SurfaceLoad::getNumDOF(void)
170179
{
171-
return SL_NUM_DOF;
180+
return numDOF;
172181
}
173182

174183
void
@@ -188,7 +197,24 @@ SurfaceLoad::setDomain(Domain *theDomain)
188197
dcrd2 = theNodes[1]->getCrds();
189198
dcrd3 = theNodes[2]->getCrds();
190199
dcrd4 = theNodes[3]->getCrds();
200+
if (3 != dcrd1.Size() || 3 != dcrd2.Size() || 3 != dcrd3.Size() || 3 != dcrd4.Size()) {
201+
opserr << "SurfaceLoad::setDomain() - nodes are not defined in three dimensions" << endln;
202+
return;
203+
}
191204

205+
int ndf1 = theNodes[0]->getNumberDOF();
206+
int ndf2 = theNodes[1]->getNumberDOF();
207+
int ndf3 = theNodes[2]->getNumberDOF();
208+
int ndf4 = theNodes[3]->getNumberDOF();
209+
if (ndf1 != ndf2 || ndf1 != ndf3 || ndf1 != ndf4) {
210+
opserr << "SurfaceLoad::setDomain() - nodes have differing numbers of DOFs" << endln;
211+
return;
212+
}
213+
214+
numDOF = SL_NUM_NODE*ndf1;
215+
theMatrix = (numDOF == 12) ? &tangentStiffness12 : &tangentStiffness24;
216+
theVector = (numDOF == 12) ? &internalForces12 : &internalForces24;
217+
192218
// call the base class method
193219
this->DomainComponent::setDomain(theDomain);
194220
}
@@ -254,14 +280,15 @@ SurfaceLoad::UpdateBase(double Xi, double Eta)
254280
const Matrix &
255281
SurfaceLoad::getTangentStiff(void)
256282
{
257-
tangentStiffness.Zero();
258-
return tangentStiffness;
283+
//theMatrix->Zero();
284+
return *theMatrix;
259285
}
260286

261287
const Matrix &
262288
SurfaceLoad::getInitialStiff(void)
263289
{
264-
return getTangentStiff();
290+
//theMatrix->Zero();
291+
return *theMatrix;
265292
}
266293

267294
void
@@ -296,22 +323,23 @@ SurfaceLoad::addInertiaLoadToUnbalance(const Vector &accel)
296323
const Vector &
297324
SurfaceLoad::getResistingForce()
298325
{
299-
internalForces.Zero();
326+
theVector->Zero();
300327

328+
int nodeDOF = (numDOF == 12) ? 3 : 6;
301329
// loop over Gauss points
302330
for(int i = 0; i < 4; i++) {
303331
this->UpdateBase(GsPts[i][0],GsPts[i][1]);
304332

305333
// loop over nodes
306-
for(int j = 0; j < 4; j++) {
307-
// loop over dof
334+
for(int j = 0; j < SL_NUM_NODE; j++) {
335+
// loop over displacement dof
308336
for(int k = 0; k < 3; k++) {
309-
internalForces[j*3+k] = internalForces[j*3+k] - mLoadFactor*my_pressure*myNhat(k)*myNI(j);
337+
(*theVector)[j*nodeDOF+k] -= mLoadFactor*my_pressure*myNhat(k)*myNI(j);
310338
}
311339
}
312340
}
313341

314-
return internalForces;
342+
return *theVector;
315343
}
316344

317345
const Vector &

‎SRC/element/surfaceLoad/SurfaceLoad.h‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,16 @@ class SurfaceLoad : public Element
9797
int UpdateBase(double Xi, double Eta);
9898

9999
ID myExternalNodes; // contains the tags of the end nodes
100-
static Matrix tangentStiffness; // Tangent Stiffness matrix
101-
static Vector internalForces; // vector of Internal Forces
102-
static Vector theVector; // vector to return the residual
100+
static Matrix tangentStiffness12; // Tangent Stiffness matrix for 4 x 3 dofs/node
101+
static Vector internalForces12; // vector of Internal Forces for 4 x 3 dofs/node
102+
static Matrix tangentStiffness24; // Tangent Stiffness matrix for 4 x 6 dofs/node
103+
static Vector internalForces24; // vector of Internal Forces for 4 x 6 dofs/node
103104

105+
int numDOF; // number of element dofs (12 or 24)
106+
107+
Matrix *theMatrix;
108+
Vector *theVector;
109+
104110
double my_pressure; // pressure applied to surface of element
105111

106112
Node *theNodes[SL_NUM_NODE];

0 commit comments

Comments
 (0)