本文整理汇总了C++中Dof::hasBc方法的典型用法代码示例。如果您正苦于以下问题:C++ Dof::hasBc方法的具体用法?C++ Dof::hasBc怎么用?C++ Dof::hasBc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dof
的用法示例。
在下文中一共展示了Dof::hasBc方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateDofUnknownsDictionary
void IncrementalLinearStatic :: updateDofUnknownsDictionary(DofManager *inode, TimeStep *tStep)
{
// update DOF unknowns dictionary, where
// unknowns are hold instead of keeping them in global unknowns
// vectors in engng instances
// this is necessary, because during solution equation numbers for
// particular DOFs may changed, and it is necessary to keep them
// in DOF level.
int ndofs = inode->giveNumberOfDofs();
Dof *iDof;
double val;
for ( int i = 1; i <= ndofs; i++ ) {
iDof = inode->giveDof(i);
// skip slave DOFs (only master (primary) DOFs have to be updated).
if (!iDof->isPrimaryDof()) continue;
val = iDof->giveUnknown(VM_Total, tStep);
if ( !iDof->hasBc(tStep) ) {
val += this->incrementOfDisplacementVector.at( iDof->__giveEquationNumber() );
}
iDof->updateUnknownsDictionary(tStep, VM_Total_Old, val);
iDof->updateUnknownsDictionary(tStep, VM_Total, val);
}
}
示例2: buildReactionTable
void
StructuralEngngModel :: buildReactionTable(IntArray &restrDofMans, IntArray &restrDofs,
IntArray &eqn, TimeStep *tStep, int di)
{
// determine number of restrained dofs
Domain *domain = this->giveDomain(di);
int numRestrDofs = this->giveNumberOfPrescribedDomainEquations(di, EID_MomentumBalance);
int ndofMan = domain->giveNumberOfDofManagers();
int i, j, indofs, rindex, count = 0;
DofManager *inode;
Dof *jdof;
// initialize corresponding dofManagers and dofs for each restrained dof
restrDofMans.resize(numRestrDofs);
restrDofs.resize(numRestrDofs);
eqn.resize(numRestrDofs);
for ( i = 1; i <= ndofMan; i++ ) {
inode = domain->giveDofManager(i);
indofs = inode->giveNumberOfDofs();
for ( j = 1; j <= indofs; j++ ) {
jdof = inode->giveDof(j);
if ( ( jdof->giveClassID() != SimpleSlaveDofClass ) && ( jdof->hasBc(tStep) ) ) { // skip slave dofs
rindex = jdof->__givePrescribedEquationNumber();
if ( rindex ) {
count++;
restrDofMans.at(count) = i;
restrDofs.at(count) = j;
eqn.at(count) = rindex;
} else {
// NullDof has no equation number and no prescribed equation number
//_error ("No prescribed equation number assigned to supported DOF");
}
}
}
}
}
示例3: 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
//.........这里部分代码省略.........