本文整理汇总了C++中FE_Element::getTangent方法的典型用法代码示例。如果您正苦于以下问题:C++ FE_Element::getTangent方法的具体用法?C++ FE_Element::getTangent怎么用?C++ FE_Element::getTangent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FE_Element
的用法示例。
在下文中一共展示了FE_Element::getTangent方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
int
IncrementalIntegrator::formTangent(int statFlag)
{
int result = 0;
statusFlag = statFlag;
if (theAnalysisModel == 0 || theSOE == 0) {
opserr << "WARNING IncrementalIntegrator::formTangent() -";
opserr << " no AnalysisModel or LinearSOE have been set\n";
return -1;
}
// zero the A matrix of the linearSOE
theSOE->zeroA();
// the loops to form and add the tangents are broken into two for
// efficiency when performing parallel computations - CHANGE
// loop through the FE_Elements adding their contributions to the tangent
FE_Element *elePtr;
FE_EleIter &theEles2 = theAnalysisModel->getFEs();
while((elePtr = theEles2()) != 0)
if (theSOE->addA(elePtr->getTangent(this),elePtr->getID()) < 0) {
opserr << "WARNING IncrementalIntegrator::formTangent -";
opserr << " failed in addA for ID " << elePtr->getID();
result = -3;
}
return result;
}
示例2: theDofs
int
RitzIntegrator::formM()
{
if (theAnalysisModel == 0 || theSOE == 0) {
opserr << "WARNING RitzIntegrator::formM -";
opserr << " no AnalysisModel or EigenSOE has been set\n";
return -1;
}
// the loops to form and add the tangents are broken into two for
// efficiency when performing parallel computations
// loop through the FE_Elements getting them to form the tangent
// FE_EleIter &theEles1 = theAnalysisModel->getFEs();
FE_Element *elePtr;
flagK = 1;
theSOE->zeroM();
// while((elePtr = theEles1()) != 0)
// elePtr->formTangent(this);
// loop through the FE_Elements getting them to add the tangent
int result = 0;
FE_EleIter &theEles2 = theAnalysisModel->getFEs();
while((elePtr = theEles2()) != 0) {
if (theSOE->addM(elePtr->getTangent(this), elePtr->getID()) < 0) {
opserr << "WARNING RitzIntegrator::formM -";
opserr << " failed in addM for ID " << elePtr->getID();
result = -2;
}
}
DOF_Group *dofPtr;
DOF_GrpIter &theDofs = theAnalysisModel->getDOFs();
while((dofPtr = theDofs()) != 0) {
// dofPtr->formTangent(this);
if (theSOE->addM(dofPtr->getTangent(this),dofPtr->getID()) < 0) {
opserr << "WARNING RitzIntegrator::formM -";
opserr << " failed in addM for ID " << dofPtr->getID();
result = -3;
}
}
return result;
}
示例3: while
int
TransientIntegrator::formTangent(int statFlag)
{
int result = 0;
statusFlag = statFlag;
LinearSOE *theLinSOE = this->getLinearSOE();
AnalysisModel *theModel = this->getAnalysisModel();
if (theLinSOE == 0 || theModel == 0) {
opserr << "WARNING TransientIntegrator::formTangent() ";
opserr << "no LinearSOE or AnalysisModel has been set\n";
return -1;
}
// the loops to form and add the tangents are broken into two for
// efficiency when performing parallel computations
theLinSOE->zeroA();
// loop through the DOF_Groups and add the unbalance
DOF_GrpIter &theDOFs = theModel->getDOFs();
DOF_Group *dofPtr;
while ((dofPtr = theDOFs()) != 0) {
if (theLinSOE->addA(dofPtr->getTangent(this),dofPtr->getID()) <0) {
opserr << "TransientIntegrator::formTangent() - failed to addA:dof\n";
result = -1;
}
}
// loop through the FE_Elements getting them to add the tangent
FE_EleIter &theEles2 = theModel->getFEs();
FE_Element *elePtr;
while((elePtr = theEles2()) != 0) {
if (theLinSOE->addA(elePtr->getTangent(this),elePtr->getID()) < 0) {
opserr << "TransientIntegrator::formTangent() - failed to addA:ele\n";
result = -2;
}
}
return result;
}
示例4: theEigenvalues
int
DirectIntegrationAnalysis::eigen(int numMode, bool generalized)
{
if (theAnalysisModel == 0 || theEigenSOE == 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() - no EigenSOE has been set\n";
return -1;
}
int result = 0;
Domain *the_Domain = this->getDomainPtr();
result = theAnalysisModel->eigenAnalysis(numMode, generalized);
int stamp = the_Domain->hasDomainChanged();
if (stamp != domainStamp) {
domainStamp = stamp;
result = this->domainChanged();
if (result < 0) {
opserr << "DirectIntegrationAnalysis::eigen() - domainChanged failed";
return -1;
}
}
//
// zero A and M
//
theEigenSOE->zeroA();
theEigenSOE->zeroM();
//
// form K
//
FE_EleIter &theEles = theAnalysisModel->getFEs();
FE_Element *elePtr;
while((elePtr = theEles()) != 0) {
elePtr->zeroTangent();
elePtr->addKtToTang(1.0);
if (theEigenSOE->addA(elePtr->getTangent(0), elePtr->getID()) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() -";
opserr << " failed in addA for ID " << elePtr->getID();
result = -2;
}
}
//
// if generalized is true, form M
//
if (generalized == true) {
int result = 0;
FE_EleIter &theEles2 = theAnalysisModel->getFEs();
while((elePtr = theEles2()) != 0) {
elePtr->zeroTangent();
elePtr->addMtoTang(1.0);
if (theEigenSOE->addM(elePtr->getTangent(0), elePtr->getID()) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() -";
opserr << " failed in addA for ID " << elePtr->getID();
result = -2;
}
}
DOF_Group *dofPtr;
DOF_GrpIter &theDofs = theAnalysisModel->getDOFs();
while((dofPtr = theDofs()) != 0) {
dofPtr->zeroTangent();
dofPtr->addMtoTang(1.0);
if (theEigenSOE->addM(dofPtr->getTangent(0),dofPtr->getID()) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() -";
opserr << " failed in addM for ID " << dofPtr->getID();
result = -3;
}
}
}
//
// solve for the eigen values & vectors
//
if (theEigenSOE->solve(numMode, generalized) < 0) {
opserr << "WARNING DirectIntegrationAnalysis::eigen() - EigenSOE failed in solve()\n";
return -4;
}
//
// now set the eigenvalues and eigenvectors in the model
//
theAnalysisModel->setNumEigenvectors(numMode);
Vector theEigenvalues(numMode);
for (int i = 1; i <= numMode; i++) {
theEigenvalues[i-1] = theEigenSOE->getEigenvalue(i);
theAnalysisModel->setEigenvector(i, theEigenSOE->getEigenvector(i));
}
theAnalysisModel->setEigenvalues(theEigenvalues);
//.........这里部分代码省略.........