示例#1
0
void
InteractionPFEMParticle :: givePrescribedUnknownVector(FloatArray &answer, const IntArray &dofIDArry,
                                                       ValueModeType mode, TimeStep *stepN)
{
    answer.resize( dofIDArry.giveSize() );


    FloatArray velocities;
    FluidStructureProblem *fsiProblem = this->giveFluidStructureMasterProblem();
    if (fsiProblem) {
        StructuralEngngModel *structuralProblem = this->giveStructuralProblem();
        if ( structuralProblem ) {
            int j = 1;
            if (fsiProblem->giveIterationNumber() < 1) {  
                for (int dofid: dofIDArry ) {
                    answer.at(j++) = this->giveDofWithID( dofid )->giveBcValue(mode, stepN);
                }
            } else {
                DofManager *dman = structuralProblem->giveDomain(1)->giveDofManager(coupledNode);
                //dman->giveUnknownVectorOfType(velocities, VelocityVector, VM_Velocity, stepN);
                //dman->giveUnknownVector(velocities, dofIDArry, VM_Velocity, stepN);
                dman->giveCompleteUnknownVector(velocities, VM_Velocity, stepN);
                for ( int dofid: dofIDArry) {
                    answer.at(dofid) = velocities.at( dofid );
                }
            }
        }
    }

    // Transform to global c.s.
    FloatMatrix L2G;
    if (this->computeL2GTransformation(L2G, dofIDArry)) {
        answer.rotatedWith(L2G, 'n');
    }
}
示例#2
0
void
InteractionPFEMParticle::giveCoupledVelocities(FloatArray &answer, TimeStep *stepN)
{
    StructuralEngngModel* structuralProblem = this->giveStructuralProblem();
    if ( structuralProblem ) {
        DofManager *dman = structuralProblem->giveDomain(1)->giveDofManager(coupledNode);
        dman->giveCompleteUnknownVector(answer, VM_Velocity, stepN);
    }
}
void GnuplotExportModule :: outputNodeDisp(DofManager &iDMan, TimeStep *tStep)
{
    // Append node solution to history
    FloatArray nodeSol;
    iDMan.giveCompleteUnknownVector(nodeSol, VM_Total, tStep);

    mMonitorNodeDispHist.push_back(nodeSol);


    // Write to file
    std::vector< std::vector<FloatArray> > nodeDispHist;
    nodeDispHist.push_back(mMonitorNodeDispHist);

    std :: string name = "MonitorNodeSolGnuplot.dat";
    WritePointsToGnuplot(name, nodeDispHist);
}