本文整理汇总了C++中Dof::giveBcValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Dof::giveBcValue方法的具体用法?C++ Dof::giveBcValue怎么用?C++ Dof::giveBcValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dof
的用法示例。
在下文中一共展示了Dof::giveBcValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: solveYourselfAt
void IncrementalLinearStatic :: solveYourselfAt(TimeStep *tStep)
{
// Creates system of governing eq's and solves them at given time step
// Initiates the total displacement to zero.
if ( tStep->isTheFirstStep() ) {
Domain *d = this->giveDomain(1);
for ( int i = 1; i <= d->giveNumberOfDofManagers(); i++ ) {
DofManager *dofman = d->giveDofManager(i);
for ( int j = 1; j <= dofman->giveNumberOfDofs(); j++ ) {
dofman->giveDof(j)->updateUnknownsDictionary(tStep, VM_Total_Old, 0.);
dofman->giveDof(j)->updateUnknownsDictionary(tStep, VM_Total, 0.);
// This is actually redundant now;
//dofman->giveDof(j)->updateUnknownsDictionary(tStep, VM_Incremental, 0.);
}
}
int nbc = d->giveNumberOfBoundaryConditions();
for ( int ibc = 1; ibc <= nbc; ++ibc ) {
GeneralBoundaryCondition *bc = d->giveBc(ibc);
ActiveBoundaryCondition *abc;
if ( ( abc = dynamic_cast< ActiveBoundaryCondition * >( bc ) ) ) {
int ndman = abc->giveNumberOfInternalDofManagers();
for ( int i = 1; i <= ndman; i++ ) {
DofManager *dofman = abc->giveInternalDofManager(i);
for ( int j = 1; j <= dofman->giveNumberOfDofs(); j++ ) {
dofman->giveDof(j)->updateUnknownsDictionary(tStep, VM_Total_Old, 0.);
dofman->giveDof(j)->updateUnknownsDictionary(tStep, VM_Total, 0.);
// This is actually redundant now;
//dofman->giveDof(j)->updateUnknownsDictionary(tStep, VM_Incremental, 0.);
}
}
}
}
}
// Apply dirichlet b.c's on total values
Domain *d = this->giveDomain(1);
for ( int i = 1; i <= d->giveNumberOfDofManagers(); i++ ) {
DofManager *dofman = d->giveDofManager(i);
for ( int j = 1; j <= dofman->giveNumberOfDofs(); j++ ) {
Dof *d = dofman->giveDof(j);
double tot = d->giveUnknown(VM_Total_Old, tStep);
if ( d->hasBc(tStep) ) {
tot += d->giveBcValue(VM_Incremental, tStep);
}
d->updateUnknownsDictionary(tStep, VM_Total, tot);
}
}
#ifdef VERBOSE
OOFEM_LOG_RELEVANT( "Solving [step number %8d, time %15e]\n", tStep->giveNumber(), tStep->giveTargetTime() );
#endif
int neq = this->giveNumberOfDomainEquations(1, EModelDefaultEquationNumbering());
if (neq == 0) { // Allows for fully prescribed/empty problems.
return;
}
incrementOfDisplacementVector.resize(neq);
incrementOfDisplacementVector.zero();
#ifdef VERBOSE
OOFEM_LOG_INFO("Assembling load\n");
#endif
// Assembling the element part of load vector
internalLoadVector.resize(neq);
internalLoadVector.zero();
this->assembleVector( internalLoadVector, tStep, EID_MomentumBalance, InternalForcesVector,
VM_Total, EModelDefaultEquationNumbering(), this->giveDomain(1) );
loadVector.resize(neq);
loadVector.zero();
this->assembleVector( loadVector, tStep, EID_MomentumBalance, ExternalForcesVector,
VM_Total, EModelDefaultEquationNumbering(), this->giveDomain(1) );
loadVector.subtract(internalLoadVector);
#ifdef VERBOSE
OOFEM_LOG_INFO("Assembling stiffness matrix\n");
#endif
if ( stiffnessMatrix ) {
delete stiffnessMatrix;
}
stiffnessMatrix = classFactory.createSparseMtrx(sparseMtrxType);
if ( stiffnessMatrix == NULL ) {
_error("solveYourselfAt: sparse matrix creation failed");
}
stiffnessMatrix->buildInternalStructure( this, 1, EID_MomentumBalance, EModelDefaultEquationNumbering() );
stiffnessMatrix->zero();
this->assemble( stiffnessMatrix, tStep, EID_MomentumBalance, StiffnessMatrix,
EModelDefaultEquationNumbering(), this->giveDomain(1) );
#ifdef VERBOSE
//.........这里部分代码省略.........