Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/OpenSees/OpenSees
Browse files Browse the repository at this point in the history
X. Du - Merge updates from official OpenSees
  • Loading branch information
xinlong-du committed Jun 14, 2021
2 parents e596c9f + e99ed0f commit 344d5c4
Show file tree
Hide file tree
Showing 43 changed files with 5,288 additions and 2,123 deletions.
3 changes: 3 additions & 0 deletions SRC/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ ELE_LIBS = $(FE)/element/Element.o \
$(FE)/element/dispBeamColumn/DispBeamColumnNL2d.o \
$(FE)/element/dispBeamColumn/DispBeamColumn2dThermal.o \
$(FE)/element/dispBeamColumn/DispBeamColumn3d.o \
$(FE)/element/dispBeamColumn/DispBeamColumnNL3d.o \
$(FE)/element/dispBeamColumn/DispBeamColumnWarping3d.o \
$(FE)/element/dispBeamColumn/DispBeamColumnAsym3d.o \
$(FE)/element/dispBeamColumn/DispBeamColumn3dThermal.o \
Expand Down Expand Up @@ -628,6 +629,8 @@ ELE_LIBS = $(FE)/element/Element.o \
$(FE)/element/PFEMElement/HigherOrder.o \
$(FE)/element/PFEMElement/Mesh.o \
$(FE)/element/PFEMElement/PFEMContact2D.o \
$(FE)/element/PFEMElement/BNode.o \
$(FE)/element/PFEMElement/BCell.o \
$(FE)/element/UWelements/SSPquad.o \
$(FE)/element/UWelements/SSPquadUP.o \
$(FE)/element/UWelements/SSPbrick.o \
Expand Down
19 changes: 3 additions & 16 deletions SRC/analysis/integrator/PFEMIntegrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ OPS_PFEMIntegrator(void)
TransientIntegrator *theIntegrator = 0;

int dispFlag = 2;
int init = 1;
int init = 2;
double dData[2] = {-1.0, -1.0};
int numData = 2;
if (OPS_GetNumRemainingInputArgs() > 1) {
Expand Down Expand Up @@ -262,10 +262,10 @@ int PFEMIntegrator::newStep(double deltaT)
*U = *Ut;
*Udotdot = *Utdotdot;
if (gamma>0 && beta>0) {
U->addVector(1.0, *Utdot, deltaT*(1-beta/gamma));
U->addVector(1.0, *Utdot, deltaT*(1.0-beta/gamma));
U->addVector(1.0, *Udot, deltaT*beta/gamma);
U->addVector(1.0, *Utdotdot, deltaT*deltaT*(0.5-beta/gamma));
Udotdot->addVector((1-1.0/gamma), *Udot, 1.0/(gamma*deltaT));
Udotdot->addVector((1.0-1.0/gamma), *Udot, 1.0/(gamma*deltaT));
Udotdot->addVector(1.0, *Utdot, -1.0/(gamma*deltaT));
} else {
U->addVector(1.0, *Udot, deltaT);
Expand Down Expand Up @@ -369,13 +369,6 @@ PFEMIntegrator::formTangent(int statFlag)
DOF_Group *dofPtr;

while ((dofPtr = theDOFs()) != 0) {
PFEMLinSOE* soe = dynamic_cast<PFEMLinSOE*>(getLinearSOE());
if (soe != 0) {
if (soe->skipFluid() && soe->isFluidID(dofPtr->getID())) {
continue;
}
}

if (theLinSOE->addA(dofPtr->getTangent(this),dofPtr->getID()) <0) {
opserr << "TransientIntegrator::formTangent() - failed to addA:dof\n";
result = -1;
Expand All @@ -386,12 +379,6 @@ PFEMIntegrator::formTangent(int statFlag)
FE_EleIter &theEles2 = theModel->getFEs();
FE_Element *elePtr;
while((elePtr = theEles2()) != 0) {
PFEMLinSOE* soe = dynamic_cast<PFEMLinSOE*>(getLinearSOE());
if (soe != 0) {
if (soe->skipFluid() && soe->isFluidID(elePtr->getID())) {
continue;
}
}
if (theLinSOE->addA(elePtr->getTangent(this),elePtr->getID()) < 0) {
opserr << "TransientIntegrator::formTangent() - failed to addA:ele\n";
result = -2;
Expand Down
1 change: 1 addition & 0 deletions SRC/classTags.h
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,7 @@
#define ELE_TAG_DispBeamColumnNL2d 621
#define ELE_TAG_TimoshenkoBeamColumn2d 63
#define ELE_TAG_DispBeamColumn3d 64
#define ELE_TAG_DispBeamColumnNL3d 640
#define ELE_TAG_DispBeamColumnWarping3d 641
#define ELE_TAG_DispBeamColumnAsym3d 642
#define ELE_TAG_HingedBeam2d 65
Expand Down
34 changes: 3 additions & 31 deletions SRC/convergenceTest/CTestPFEM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ int CTestPFEM::test(void)
const Vector &x = theSOE->getX();
const Vector &B = theSOE->getB();
const ID& dofType = theSOE->getDofType();
int stage = theSOE->getStage();
if(dofType.Size() != x.Size()) {
opserr << "WARNING: x and dofType have different size -- CTestPFEM::test()\n";
return -2;
Expand Down Expand Up @@ -227,18 +226,6 @@ int CTestPFEM::test(void)
normprel = 0.0;
}

if (stage==1 || stage==3) {
normp = 0;
normresp = 0;
normprel = 0;
normpi = 0;
normrespi = 0;
} else if (stage == 2) {
normv = 0;
normresv = 0;
normvrel = 0;
}

// record norms
if(currentIter <= maxNumIter) {
normsv.push_back(normv);
Expand All @@ -248,7 +235,7 @@ int CTestPFEM::test(void)
}

// check for norm increase
if(stage==0 && currentIter > 1 && maxIncr > 0) {
if(currentIter > 1 && maxIncr > 0) {
if(normv>10*normsv[currentIter-2] || normp>10*normsp[currentIter-2] ||
normresv>10*normsresv[currentIter-2] || normresp>10*normsresp[currentIter-2]) {
numIncr++;
Expand All @@ -258,13 +245,6 @@ int CTestPFEM::test(void)
// print the data if required
if(printFlag == 1) {
opserr << "PFEM: " << currentIter;
if (stage == 1) {
opserr << " -- Predictor Stage\n";
} else if (stage == 2) {
opserr << " -- Pressure Stage\n";
} else if (stage == 3) {
opserr << " -- Corrector Stage\n";
}
opserr << " dV(" << normv << "," << normvrel;
opserr << "), dP(" << normp << "," << normprel;
opserr << "), dPi(" << normpi;
Expand Down Expand Up @@ -303,13 +283,8 @@ int CTestPFEM::test(void)
}
}

if (stage == 1) {
theSOE->setStage(2);
} else if (stage == 0 || stage == 3) {

// return the number of times test has been called
return currentIter;
}
// return the number of times test has been called
return currentIter;
}

// algo failed to converged after specified number of iterations - but RETURN OK
Expand Down Expand Up @@ -342,9 +317,6 @@ int CTestPFEM::test(void)
}

// algorithm not yet converged - increment counter and return -1
if (stage == 2) {
theSOE->setStage(3);
}
currentIter++;
return -1;
}
Expand Down
74 changes: 38 additions & 36 deletions SRC/domain/domain/Domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,43 +489,45 @@ Domain::addNode(Node * node)
node->setDomain(this);
this->domainChange();

// see if the physical bounds are changed
// note this assumes 0,0,0,0,0,0 as startup min,max values
const Vector& crds = node->getCrds();
int dim = crds.Size();
if (initBounds) {
if (dim >= 1) {
double x = crds(0);
theBounds(0) = x;
theBounds(3) = x;
}
if (dim >= 2) {
double y = crds(1);
theBounds(1) = y;
theBounds(4) = y;
}
if (dim == 3) {
double z = crds(2);
theBounds(2) = z;
theBounds(5) = z;
}
initBounds = false;
}
else {
if (dim >= 1) {
double x = crds(0);
if (x < theBounds(0)) theBounds(0) = x;
if (x > theBounds(3)) theBounds(3) = x;
}
if (dim >= 2) {
double y = crds(1);
if (y < theBounds(1)) theBounds(1) = y;
if (y > theBounds(4)) theBounds(4) = y;
if (!resetBounds) {
// see if the physical bounds are changed
// note this assumes 0,0,0,0,0,0 as startup min,max values
const Vector& crds = node->getCrds();
int dim = crds.Size();
if (initBounds) {
if (dim >= 1) {
double x = crds(0);
theBounds(0) = x;
theBounds(3) = x;
}
if (dim >= 2) {
double y = crds(1);
theBounds(1) = y;
theBounds(4) = y;
}
if (dim == 3) {
double z = crds(2);
theBounds(2) = z;
theBounds(5) = z;
}
initBounds = false;
}
if (dim == 3) {
double z = crds(2);
if (z < theBounds(2)) theBounds(2) = z;
if (z > theBounds(5)) theBounds(5) = z;
else {
if (dim >= 1) {
double x = crds(0);
if (x < theBounds(0)) theBounds(0) = x;
if (x > theBounds(3)) theBounds(3) = x;
}
if (dim >= 2) {
double y = crds(1);
if (y < theBounds(1)) theBounds(1) = y;
if (y > theBounds(4)) theBounds(4) = y;
}
if (dim == 3) {
double z = crds(2);
if (z < theBounds(2)) theBounds(2) = z;
if (z > theBounds(5)) theBounds(5) = z;
}
}
}
} else
Expand Down
3 changes: 2 additions & 1 deletion SRC/domain/domain/partitioned/PartitionedDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,8 +1402,9 @@ PartitionedDomain::removeRecorders(void)
if (this->Domain::removeRecorders() < 0)
return -1;

#ifdef _PARALLEL_PROCESSING
this->barrierCheck(1.0);

#endif
return 0;
}

Expand Down
48 changes: 48 additions & 0 deletions SRC/element/PFEMElement/BCell.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** **
** (C) Copyright 1999, The Regents of the University of California **
** All Rights Reserved. **
** **
** Commercial use of this program without express permission of the **
** University of California, Berkeley, is strictly prohibited. See **
** file 'COPYRIGHT' in main directory for information on usage and **
** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
** **
** Developed by: **
** Frank McKenna (fmckenna@ce.berkeley.edu) **
** Gregory L. Fenves (fenves@ce.berkeley.edu) **
** Filip C. Filippou (filippou@ce.berkeley.edu) **
** **
** ****************************************************************** */

// Written: Minjie Zhu
//
//

#include "BCell.h"

#include "BNode.h"

BCell::BCell() : pts(), type(BACKGROUND_FLUID), bnodes(), bindices() {}

void BCell::add(Particle* pt) { pts.push_back(pt); }

void BCell::setType(BackgroundType t) { type = t; }

BackgroundType BCell::getType() const { return type; }

VParticle& BCell::getPts() { return pts; }

std::vector<BNode*>& BCell::getNodes() { return bnodes; }

std::vector<VInt>& BCell::getIndices() { return bindices; }

void BCell::addNode(BNode* bnode, const VInt& index) {
bnodes.push_back(bnode);
bindices.push_back(index);
}

void BCell::clearParticles() { pts.clear(); }
55 changes: 55 additions & 0 deletions SRC/element/PFEMElement/BCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* ****************************************************************** **
** OpenSees - Open System for Earthquake Engineering Simulation **
** Pacific Earthquake Engineering Research Center **
** **
** **
** (C) Copyright 1999, The Regents of the University of California **
** All Rights Reserved. **
** **
** Commercial use of this program without express permission of the **
** University of California, Berkeley, is strictly prohibited. See **
** file 'COPYRIGHT' in main directory for information on usage and **
** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
** **
** Developed by: **
** Frank McKenna (fmckenna@ce.berkeley.edu) **
** Gregory L. Fenves (fenves@ce.berkeley.edu) **
** Filip C. Filippou (filippou@ce.berkeley.edu) **
** **
** ****************************************************************** */

// Written: Minjie Zhu
//
//

#ifndef BCell_h
#define BCell_h

#include "BackgroundDef.h"

class BNode;

// BACKGROUND_FLUID - a grid fluid cell
// BACKGROUND_STRUCTURE - a structural cell, which should have no particles
class BCell {
private:
VParticle pts;
BackgroundType type;
std::vector<BNode*> bnodes;
std::vector<VInt> bindices;

public:
BCell();
void add(Particle* pt);
void setType(BackgroundType t);
BackgroundType getType() const;
VParticle& getPts();
std::vector<BNode*>& getNodes();
std::vector<VInt>& getIndices();

void addNode(BNode* bnode, const VInt& index);

void clearParticles();
};

#endif
Loading

0 comments on commit 344d5c4

Please sign in to comment.