当前位置: 首页>>代码示例>>C++>>正文


C++ Load类代码示例

本文整理汇总了C++中Load的典型用法代码示例。如果您正苦于以下问题:C++ Load类的具体用法?C++ Load怎么用?C++ Load使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Load类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: computeExternalForcesVector

void Tr21Stokes :: computeExternalForcesVector(FloatArray &answer, TimeStep *tStep)
{
    FloatArray vec;

    answer.clear();

    int nLoads = this->boundaryLoadArray.giveSize() / 2;
    for ( int i = 1; i <= nLoads; i++ ) {  // For each Neumann boundary condition
        int load_number = this->boundaryLoadArray.at(2 * i - 1);
        int load_id = this->boundaryLoadArray.at(2 * i);
        Load *load = this->domain->giveLoad(load_number);
        bcGeomType ltype = load->giveBCGeoType();

        if ( ltype == EdgeLoadBGT ) {
            this->computeBoundarySurfaceLoadVector(vec, static_cast< BoundaryLoad * >(load), load_id, ExternalForcesVector, VM_Total, tStep);
            answer.add(vec);
        }
    }

    BodyLoad *bload;
    nLoads = this->giveBodyLoadArray()->giveSize();
    for ( int i = 1; i <= nLoads; i++ ) {
        Load *load = domain->giveLoad( bodyLoadArray.at(i) );
	if ((bload = dynamic_cast<BodyLoad*>(load))) {
	  bcGeomType ltype = load->giveBCGeoType();
	  if ( ltype == BodyLoadBGT && load->giveBCValType() == ForceLoadBVT ) {
            this->computeLoadVector(vec, bload, ExternalForcesVector, VM_Total, tStep);
            answer.add(vec);
	  }
        }
    }
}
开发者ID:aishugang,项目名称:oofem,代码行数:32,代码来源:tr21stokes.C

示例2: beginOps

void
CrundDriver::runOperations(Load& load, int nOps) {
    beginOps(nOps);
    load.clearData();
    load.runOperations(nOps);
    finishOps(nOps); 
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:7,代码来源:CrundDriver.cpp

示例3: computeBCLhsPressureTerm_MB

void
SUPGElement :: computeBCLhsPressureTerm_MB(FloatMatrix &answer, TimeStep *tStep)
{
    bcType boundarytype;
    int nLoads = 0;
    //bcType loadtype;
    FloatMatrix helpMatrix;
    // loop over boundary load array
    answer.clear();

    nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;

    if ( nLoads ) {
        for ( int i = 1; i <= nLoads; i++ ) {
            int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
            int side = boundaryLoadArray.at(i * 2);
            Load *load = domain->giveLoad(n);
            boundarytype = load->giveType();
            if ( boundarytype == OutFlowBC ) {
                this->computeOutFlowBCTerm_MB(helpMatrix, side, tStep);
                answer.add(helpMatrix);
            } else {
                //_warning("computeForceLoadVector : unsupported load type class");
            }
        }
    }
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:27,代码来源:supgelement.C

示例4: computeLoadVector

void Tr21Stokes :: computeLoadVector(FloatArray &answer, TimeStep *tStep)
{
    int i, load_number, load_id;
    Load *load;
    bcGeomType ltype;
    FloatArray vec;

    int nLoads = this->boundaryLoadArray.giveSize() / 2;
    answer.resize(15);
    answer.zero();
    for ( i = 1; i <= nLoads; i++ ) {  // For each Neumann boundary condition
        load_number = this->boundaryLoadArray.at(2 * i - 1);
        load_id = this->boundaryLoadArray.at(2 * i);
        load = this->domain->giveLoad(load_number);
        ltype = load->giveBCGeoType();

        if ( ltype == EdgeLoadBGT ) {
            this->computeEdgeBCSubVectorAt(vec, load, load_id, tStep);
            answer.add(vec);
        }
    }

    nLoads = this->giveBodyLoadArray()->giveSize();
    for ( i = 1; i <= nLoads; i++ ) {
        load  = domain->giveLoad( bodyLoadArray.at(i) );
        ltype = load->giveBCGeoType();
        if ( ltype == BodyLoadBGT && load->giveBCValType() == ForceLoadBVT ) {
            this->computeBodyLoadVectorAt(vec, load, tStep);
            answer.add(vec);
        }
    }
}
开发者ID:JimBrouzoulis,项目名称:oofem-1,代码行数:32,代码来源:tr21stokes.C

示例5: Load

//=============================================================================
// 生成
//=============================================================================
bool Load::Create(Load** outPointer , LPDIRECT3DDEVICE9 device )
{
	Load* pointer = new Load();
	if(!pointer->Initialize(device))
		return false;

	*outPointer = pointer;

	return true;
}
开发者ID:tnbmi,项目名称:ms_project,代码行数:13,代码来源:load.cpp

示例6:

void
CrundDriver::reconnectDB(Load& load) {
    cout << endl
         << "------------------------------------------------------------"
         << endl
         << "renew connection ... " << endl
         << "------------------------------------------------------------"
         << endl;
    load.closeConnection();
    load.initConnection();
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:11,代码来源:CrundDriver.cpp

示例7: Load

void UndoRedo::Execute()
{
	if (Mode) //Undo
	{
		if (CurrentStep == 0)
		{
			this->pManager->GetOutput()->PrintMessage("Can't Undo, press any key to continue");
			Point Temp;
			this->pManager->GetInput()->GetPointClicked(Temp);
			this->pManager->GetOutput()->PrintMessage("");
			return;
		}
		else
		{
			CurrentStep--;
			ostringstream FileName;
			FileName << "TmpFC" << CurrentStep << ".txt";
			Load *L = new Load(pManager, FileName.str());
			L->Execute();
			this->pManager->GetOutput()->PrintMessage("Undo, press any key to continue");
			Point Temp;
			this->pManager->GetInput()->GetPointClicked(Temp);
			this->pManager->GetOutput()->PrintMessage("");
			return;
		}
	}
	else //Redo
	{
		if (CurrentStep == HistoryCounter)
		{
			this->pManager->GetOutput()->PrintMessage("Can't Redo, press any key to continue");
			Point Temp;
			this->pManager->GetInput()->GetPointClicked(Temp);
			this->pManager->GetOutput()->PrintMessage("");
			return;
		}
		else
		{
			CurrentStep++;
			ostringstream FileName;
			FileName << "TmpFC" << CurrentStep << ".txt";
			Load *L = new Load(pManager, FileName.str());
			L->Execute();
			this->pManager->GetOutput()->PrintMessage("Redo, press any key to continue");
			Point Temp;
			this->pManager->GetInput()->GetPointClicked(Temp);
			this->pManager->GetOutput()->PrintMessage("");
			return;
		}
	}
}
开发者ID:Ahmkel,项目名称:Flowchart-Creator,代码行数:51,代码来源:UndoRedo.cpp

示例8: computeBCLhsTerm_MB

void
SUPGElement :: computeBCLhsTerm_MB(FloatMatrix &answer, TimeStep *tStep)
{
    bcType boundarytype;
    int nLoads = 0;
    //bcType loadtype;
    FloatMatrix helpMatrix;
    // loop over boundary load array

    answer.clear();

    nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
    if ( nLoads ) {
        for ( int i = 1; i <= nLoads; i++ ) {
            int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
            int side = boundaryLoadArray.at(i * 2);
            Load *load = domain->giveLoad(n);
            boundarytype = load->giveType();
            if ( boundarytype == SlipWithFriction ) {
                this->computeSlipWithFrictionBCTerm_MB(helpMatrix, load, side, tStep);
                answer.add(helpMatrix);
            } else if ( boundarytype == PenetrationWithResistance ) {
                this->computePenetrationWithResistanceBCTerm_MB(helpMatrix, load, side, tStep);
                answer.add(helpMatrix);
            } else {
                // OOFEM_ERROR("unsupported load type class");
            }
        }
    }

    nLoads = this->giveBodyLoadArray()->giveSize();

    if ( nLoads ) {
        bcGeomType ltype;
        for ( int i = 1; i <= nLoads; i++ ) {
            Load *load = domain->giveLoad( bodyLoadArray.at(i) );
            ltype = load->giveBCGeoType();
            if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ReinforceBVT ) ) {
                this->computeHomogenizedReinforceTerm_MB(helpMatrix, load, tStep);
                answer.add(helpMatrix);
            }
        }
    }
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:44,代码来源:supgelement.C

示例9: computeBCLhsPressureTerm_MC

void
SUPGElement :: computeBCLhsPressureTerm_MC(FloatMatrix &answer, TimeStep *tStep)
{
    int nLoads = 0;
    //bcType loadtype;
    FloatMatrix helpMatrix;

    nLoads = this->giveBodyLoadArray()->giveSize();
    answer.clear();
    if ( nLoads ) {
        bcGeomType ltype;
        for ( int i = 1; i <= nLoads; i++ ) {
            Load *load  = domain->giveLoad( bodyLoadArray.at(i) );
            ltype = load->giveBCGeoType();
            if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ReinforceBVT ) ) {
                this->computeHomogenizedReinforceTerm_MC(helpMatrix, load, tStep);
                answer.add(helpMatrix);
            }
        }
    }
}
开发者ID:rainbowlqs,项目名称:oofem,代码行数:21,代码来源:supgelement.C

示例10: createLoad

Load createLoad(int volt,int eq,string node,double p,double q,bool off)//创建新节点
{
	Load load;
	load.setLoadVolt(volt);
	load.setLoadEq(eq);
	load.setLoadNode(node);
	load.setLoadP(p);
	load.setLoadQ(q);
	load.setLoadOff(off);
	return load;
}
开发者ID:zclzqbx,项目名称:dataProcessNew,代码行数:11,代码来源:share.cpp

示例11: computeBCRhsTerm_MB

void
SUPGElement2 :: computeBCRhsTerm_MB(FloatArray &answer, TimeStep *tStep)
{
    int nLoads;

    answer.clear();

    int rule = 0;
    IntegrationRule *iRule = this->integrationRulesArray [ rule ];
    FloatArray un, gVector, s, helpLoadVector;
    FloatMatrix b, nu;

    // add body load (gravity) termms
    nLoads = this->giveBodyLoadArray()->giveSize();
    for ( int i = 1; i <= nLoads; i++ ) {
        Load *load = domain->giveLoad( bodyLoadArray.at(i) );
        bcGeomType ltype = load->giveBCGeoType();
        if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) {
            load->computeComponentArrayAt(gVector, tStep, VM_Total);
            if ( gVector.giveSize() ) {
                for ( GaussPoint *gp: *iRule ) {
                    this->computeUDotGradUMatrix( b, gp, tStep->givePreviousStep() );
                    this->computeNuMatrix(nu, gp);
                    double dV  = this->computeVolumeAround(gp);
                    double rho = this->giveMaterial()->give('d', gp);
                    answer.plusProduct(b, gVector, t_supg * rho * dV);
                    answer.plusProduct(nu, gVector, rho * dV);
                }
            }
        }
    }

    // integrate tractions
    // if no traction bc applied but side marked as with traction load
    // then zero traction is assumed !!!

    // loop over boundary load array
    nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
    for ( int i = 1; i <= nLoads; i++ ) {
        int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
        int id = boundaryLoadArray.at(i * 2);
        Load *load  = domain->giveLoad(n);
        bcGeomType ltype = load->giveBCGeoType();
        if ( ltype == EdgeLoadBGT ) {
            this->computeEdgeLoadVector_MB(helpLoadVector, load, id, tStep);
            if ( helpLoadVector.giveSize() ) {
                answer.add(helpLoadVector);
            }
        } else if ( ltype == SurfaceLoadBGT ) {
            this->computeSurfaceLoadVector_MB(helpLoadVector, load, id, tStep);
            if ( helpLoadVector.giveSize() ) {
                answer.add(helpLoadVector);
            }
        } else {
            OOFEM_ERROR("unsupported load type class");
        }
    }
}
开发者ID:vivianyw,项目名称:oofem,代码行数:58,代码来源:supgelement2.C

示例12: computeBCRhsTerm_MC

void
SUPGElement2 :: computeBCRhsTerm_MC(FloatArray &answer, TimeStep *tStep)
{
    int nLoads;
    FloatArray s, gVector, helpLoadVector;
    FloatMatrix g;

    int rule = 1;

    answer.clear();

    nLoads = this->giveBodyLoadArray()->giveSize();
    for ( int i = 1; i <= nLoads; i++ ) {
        Load *load  = domain->giveLoad( bodyLoadArray.at(i) );
        bcGeomType ltype = load->giveBCGeoType();
        if ( ( ltype == BodyLoadBGT ) && ( load->giveBCValType() == ForceLoadBVT ) ) {
            load->computeComponentArrayAt(gVector, tStep, VM_Total);
            if ( gVector.giveSize() ) {
                for ( GaussPoint *gp: *this->integrationRulesArray [ rule ] ) {
                    this->computeGradPMatrix(g, gp);
                    double dV = this->computeVolumeAround(gp);
                    answer.plusProduct(g, gVector, t_pspg * dV);
                }
            }
        }
    }

    // integrate tractions
    // if no traction bc applied but side marked as with traction load
    // then zero traction is assumed !!!

    // loop over boundary load array
    nLoads = this->giveBoundaryLoadArray()->giveSize() / 2;
    for ( int i = 1; i <= nLoads; i++ ) {
        int n = boundaryLoadArray.at(1 + ( i - 1 ) * 2);
        int id = boundaryLoadArray.at(i * 2);
        Load *load = domain->giveLoad(n);
        bcGeomType ltype = load->giveBCGeoType();
        if ( ltype == EdgeLoadBGT ) {
            this->computeEdgeLoadVector_MC(helpLoadVector, load, id, tStep);
            if ( helpLoadVector.giveSize() ) {
                answer.add(helpLoadVector);
            }
        } else if ( ltype == SurfaceLoadBGT ) {
            this->computeSurfaceLoadVector_MC(helpLoadVector, load, id, tStep);
            if ( helpLoadVector.giveSize() ) {
                answer.add(helpLoadVector);
            }
        } else {
            OOFEM_ERROR("unsupported load type class");
        }
    }
}
开发者ID:Benjamin-git,项目名称:OOFEM_Jim,代码行数:53,代码来源:supgelement2.C

示例13: connectDB

void
CrundDriver::runLoad(Load& load) {
    connectDB(load);

    assert(nOpsStart <= nOpsEnd && nOpsScale > 1);
    for (int i = nOpsStart; i <= nOpsEnd; i *= nOpsScale) {
        cout << endl
             << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
             << endl
             << "running load ...                [nOps=" << i << "]"
             << load.getName() << endl
             << "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
             << endl;
        runSeries(load, i);
    }
    
    disconnectDB(load);
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:18,代码来源:CrundDriver.cpp

示例14: reconnectDB

void
CrundDriver::runSeries(Load& load, int nOps) {
    if (nRuns == 0)
        return; // nothing to do
    
    for (int i = 1; i <= nRuns; i++) {
        // pre-run cleanup
        if (renewConnection)
            reconnectDB(load);
        
        cout << endl
             << "------------------------------------------------------------"
             << endl
             << "run " << i << " of " << nRuns << " [nOps=" << nOps << "]"
             << endl
             << "------------------------------------------------------------"
             << endl;
        runOperations(load, nOps);
    }
    
    writeLogBuffers(load.getName());
}
开发者ID:ForcerKing,项目名称:ShaoqunXu-mysql5.7,代码行数:22,代码来源:CrundDriver.cpp

示例15: computeInternalSourceRhsVectorAt

void
Lattice2d_mt :: computeInternalSourceRhsVectorAt(FloatArray &answer, TimeStep *atTime, ValueModeType mode)
{
    int i, j, n, nLoads;
    double dV;
    bcGeomType ltype;
    Load *load;
    IntegrationRule *iRule = integrationRulesArray [ 0 ];
    GaussPoint *gp;
    Node *nodeA, *nodeB;


    FloatArray deltaX(3), normalVector(3);
    FloatArray val, helpLoadVector, globalIPcoords;
    FloatMatrix nm;
    double k;
    answer.resize(0);

    FloatArray gravityHelp(2);

    nLoads    = this->giveBodyLoadArray()->giveSize();
    for ( i = 1; i <= nLoads; i++ ) {
        n     = bodyLoadArray.at(i);
        load  = ( Load * ) domain->giveLoad(n);
        ltype = load->giveBCGeoType();

        if ( ltype == GravityPressureBGT ) {
            //Compute change of coordinates
            nodeA   = this->giveNode(1);
            nodeB   = this->giveNode(2);
            deltaX.at(1) = nodeB->giveCoordinate(1) - nodeA->giveCoordinate(1);
            deltaX.at(2) = nodeB->giveCoordinate(2) - nodeA->giveCoordinate(2);
            deltaX.at(3) = nodeB->giveCoordinate(2) - nodeA->giveCoordinate(2);

            //Compute the local coordinate system
            gp  = iRule->getIntegrationPoint(0);

            gravityHelp.at(1) = 1.;
            gravityHelp.at(2) = -1.;

            dV  = this->computeVolumeAround(gp);
            load->computeValueAt(val, atTime, deltaX, mode);

            k = static_cast< TransportMaterial * >( this->giveMaterial() )->giveCharacteristicValue(Conductivity_hh, gp, atTime);

            double helpFactor = val.at(1) * k * dV;

            helpFactor /= pow(this->giveLength(), 2.);
            gravityHelp.times(helpFactor);

            if ( helpLoadVector.isEmpty() ) {
                helpLoadVector.resize( gravityHelp.giveSize() );
            }

            for ( j = 1; j <= gravityHelp.giveSize(); j++ ) {
                helpLoadVector.at(j) += gravityHelp.at(j);
            }
        }

        answer.add(helpLoadVector);
    }

    return;
}
开发者ID:JimBrouzoulis,项目名称:OOFEM_LargeDef,代码行数:64,代码来源:lattice2d_mt.C


注:本文中的Load类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。