int
FluidDynamicMaterial :: giveIntVarCompFullIndx(IntArray &answer, InternalStateType type, MaterialMode mmode)
{
    if ( type == IST_DeviatoricStress ) {
        if ( mmode == _2dFlow ) {
            answer.setValues(3, 1, 2, 3);
            return 1;
        } else if ( mmode == _2dAxiFlow ) {
            answer.setValues(4, 1, 2, 3, 6);
            return 1;
        } else if ( mmode == _3dFlow ) {
            answer.resize(6);
            for ( int i = 1; i <= 6; i++ ) answer.at(i) = i;
            return 1;
        } else {
            OOFEM_ERROR ("FluidDynamicMaterial :: giveIntVarCompFullIndx: material mode not supported");
            return 0;
        }
    } else if ( type == IST_Viscosity ) {
        answer.resize(1); answer.at(1) = 1;
        return 1;
    }  else {
        return Material :: giveIntVarCompFullIndx(answer, type, mmode);
    }
}
Example #2
0
void Tr21Stokes :: giveDofManDofIDMask(int inode, EquationID ut, IntArray &answer) const
{
    // Returns the mask for node number inode of this element. The mask tells what quantities
    // are held by each node. Since this element holds velocities (both in x and y direction),
    // in six nodes and pressure in three nodes the answer depends on which node is requested.

    if ( ( inode == 1 ) || ( inode == 2 ) || ( inode == 3 ) ) {
        if ( ( ut == EID_MomentumBalance ) || ( ut == EID_AuxMomentumBalance ) ) {
            answer.setValues(2, V_u, V_v);
        } else if ( ut == EID_ConservationEquation ) {
            answer.setValues(1, P_f);
        } else if ( ut == EID_MomentumBalance_ConservationEquation ) {
            answer.setValues(3, V_u, V_v, P_f);
        } else {
            _error("giveDofManDofIDMask: Unknown equation id encountered");
        }
    } else if ( ( inode == 4 ) || ( inode == 5 ) || ( inode == 6 ) ) {
        if ( ( ut == EID_MomentumBalance ) || ( ut == EID_AuxMomentumBalance ) ) {
            answer.setValues(2, V_u, V_v);
        } else if ( ut == EID_ConservationEquation ) {
            answer.resize(0);
        } else if ( ut == EID_MomentumBalance_ConservationEquation ) {
            answer.setValues(2, V_u, V_v);
        } else {
            _error("giveDofManDofIDMask: Unknown equation id encountered");
        }
    }
}
Example #3
0
void
QPlaneStressGrad :: giveDofManDofIDMask(int inode, EquationID ut, IntArray &answer) const
{
    if ( inode <= nSecNodes ) {
        answer.setValues(3, D_u, D_v, G_0);
    } else {
        answer.setValues(2, D_u, D_v);
    }
}
Example #4
0
void
Truss2d :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    if ( cs_mode == 0 ) {
        answer.setValues(2, D_u, D_w);
    } else if ( cs_mode == 1 ) {
        answer.setValues(2, D_u, D_v);
    } else if ( cs_mode == 2 ) {
        answer.setValues(2, D_v, D_w);
    }
}
void LineSurfaceTension :: giveDofManDofIDMask(int inode, EquationID ut, IntArray &answer) const
// Returns the mask for this element. Should i handle EquationID gracefully?
{
    if (ut == EID_MomentumBalance || ut == EID_MomentumBalance_ConservationEquation) {
        if (this->giveDomain()->giveDomainType() == _2dIncompressibleFlow) {
            answer.setValues(2, V_u, V_v);
        } else {
            answer.setValues(2, D_u, D_v);
        }
    } else {
        answer.resize(0);
    }
}
void
Quad1MindlinShell3D :: giveEdgeDofMapping(IntArray &answer, int iEdge) const
{
    if ( iEdge == 1 ) { // edge between nodes 1 2
        answer.setValues(12,  1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12);
    } else if ( iEdge == 2 ) { // edge between nodes 2 3
        answer.setValues(12,  7, 8, 9,10,11,12,13,14,15,16,17,18);
    } else if ( iEdge == 3 ) { // edge between nodes 3 4
        answer.setValues(12, 13,14,15,16,17,18,19,20,21,22,23,24);
    } else if ( iEdge == 4 ) { // edge between nodes 4 1
        answer.setValues(12, 19,20,21,22,23,24, 1, 2, 3, 4, 5, 6);
    } else {
        _error("giveEdgeDofMapping: wrong edge number");
    }
}
Example #7
0
void
SpringElement :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    if (this->mode == SE_1D_SPRING) {
        answer.setValues(1, D_u);
    } else if (this->mode == SE_2D_SPRING_XY) {
        answer.setValues(2, D_u, D_v);
    } else if (this->mode == SE_2D_TORSIONALSPRING_XZ) {
        answer.setValues(1, R_v);
    } else if (this->mode == SE_3D_SPRING) {
        answer.setValues(3, D_u, D_v, D_w);
    } else if (this->mode == SE_3D_TORSIONALSPRING) {
        answer.setValues(3, R_u, R_v, R_w);
    }
}
Example #8
0
void
Quad1Mindlin :: giveEdgeDofMapping(IntArray &answer, int iEdge) const
{
    if ( iEdge == 1 ) { // edge between nodes 1 2
        answer.setValues(6, 1,2,3,4,5,6);
    } else if ( iEdge == 2 ) { // edge between nodes 2 3
        answer.setValues(6, 4,5,6,7,8,9);
    } else if ( iEdge == 3 ) { // edge between nodes 3 4
        answer.setValues(6, 7,8,9,10,11,12);
    } else if ( iEdge == 4 ) { // edge between nodes 4 1
        answer.setValues(6, 10,11,12,1,2,3);
    } else {
        _error("giveEdgeDofMapping: wrong edge number");
    }
}
void
FEI3dLineLin :: computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
{
    if ( iedge != 1 ) {
        OOFEM_ERROR2("FEI3dLineLin :: computeEdgeMapping: wrong edge number (%d)", iedge);
    }
    edgeNodes.setValues(2, 1, 2);
}
void
Quad10_2D_SUPG :: giveInternalDofManDofIDMask(int i, EquationID ut, IntArray &answer) const
{
    if ( ut == EID_MomentumBalance ) {
        answer.resize(0);
    } else if ( ut == EID_ConservationEquation || ut == EID_MomentumBalance_ConservationEquation ) {
        answer.setValues(1, P_f);
    } else {
        _error("giveDofManDofIDMask: Unknown equation id encountered");
    }
}
Example #11
0
void
Tr2Shell7PhFi:: giveEdgeDofMapping(IntArray &answer, int iEdge) const
{
    /*
     * provides dof mapping of local edge dofs (only nonzero are taken into account)
     * to global element dofs
     */

    if ( iEdge == 1 ) {        // edge between nodes 1-4-2
        //answer.setValues(21, 1, 2, 3, 4, 5, 6, 7,   8, 9, 10, 11, 12, 13, 14,   22, 23, 24, 25, 26, 27, 28);
        answer.setValues(21, 1, 2, 3, 8, 9, 10, 22, 23, 24,  4, 5, 6, 11, 12, 13, 25, 26, 27,   7, 14, 28);
    } else if ( iEdge == 2 ) { // edge between nodes 2-5-3
        //answer.setValues(21,   8, 9, 10, 11, 12, 13, 14,   15, 16, 17, 18, 19, 20, 21,   29, 30, 31, 32, 33, 34, 35 );
        answer.setValues(21,   8, 9, 10, 15, 16, 17, 29, 30, 31,   11, 12, 13, 18, 19, 20, 32, 33, 34,   14, 21, 35);
    } else if ( iEdge == 3 ) { // edge between nodes 3-6-1
        //answer.setValues(21,   15, 16, 17, 18, 19, 20, 21,   1, 2, 3, 4, 5, 6, 7,   36, 37, 38, 39, 40, 41, 42);
        answer.setValues(21,   15, 16, 17, 1, 2, 3, 36, 37, 38,   18, 19, 20, 4, 5, 6, 39, 40, 41,   21, 7, 42);
    } else {
        _error("giveEdgeDofMapping: wrong edge number");
    }
}
void
InterfaceElem1d :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    switch ( domain->giveDomainType() ) {
    case _2dPlaneStressMode:
    case _PlaneStrainMode:
    case _3dAxisymmMode:
        answer.setValues(2, D_u, D_v);
        break;
    case _3dMode:
        answer.setValues(3, D_u, D_v, D_w);
        break;
    case _2dTrussMode:
    case _2dBeamMode:
        answer.setValues(2, D_u, D_w);
        break;
    case _1dTrussMode:
        answer.setValues(1, D_u);
        break;
    default:
        _error("giveDofManDofIDMask: unsupported mode");
    }
}
Example #13
0
void Tr1Darcy :: giveDofManDofIDMask(int inode, EquationID ut, IntArray &answer) const
{
    /*
     * Returns the mask for node number inode of this element. The mask tells what quantities
     * are held by each node. Since this element holds velocities (both in x and y direction),
     * in six nodes and pressure in three nodes the answer depends on which node is requested.
     */

    if ( ( inode == 1 ) || ( inode == 2 ) || ( inode == 3 ) ) {
        if ( ut == EID_ConservationEquation ) {
            answer.setValues(1, P_f);
        } else {
            _error("giveDofManDofIDMask: Unknown equation id encountered");
        }
    }
}
Example #14
0
void
FEI3dHexaLin :: computeLocalEdgeMapping(IntArray &edgeNodes, int iedge)
{
    int aNode = 0, bNode = 0;

    if ( iedge == 1 ) { // edge between nodes 1 2
        aNode = 1;
        bNode = 2;
    } else if ( iedge == 2 ) { // edge between nodes 2 3
        aNode = 2;
        bNode = 3;
    } else if ( iedge == 3 ) { // edge between nodes 3 4
        aNode = 3;
        bNode = 4;
    } else if ( iedge == 4 ) { // edge between nodes 4 1
        aNode = 4;
        bNode = 1;
    } else if ( iedge == 5 ) { // edge between nodes 1 5
        aNode = 1;
        bNode = 5;
    } else if ( iedge == 6 ) { // edge between nodes 2 6
        aNode = 2;
        bNode = 6;
    } else if ( iedge == 7 ) { // edge between nodes 3 7
        aNode = 3;
        bNode = 7;
    } else if ( iedge == 8 ) { // edge between nodes 4 8
        aNode = 4;
        bNode = 8;
    } else if ( iedge == 9 ) { // edge between nodes 5 6
        aNode = 5;
        bNode = 6;
    } else if ( iedge == 10 ) { // edge between nodes 6 7
        aNode = 6;
        bNode = 7;
    } else if ( iedge == 11 ) { // edge between nodes 7 8
        aNode = 7;
        bNode = 8;
    } else if ( iedge == 12 ) { // edge between nodes 8 5
        aNode = 8;
        bNode = 5;
    } else {
        OOFEM_ERROR2("FEI3dHexaLin :: computeEdgeMapping: wrong egde number (%d)", iedge);
    }

    edgeNodes.setValues(2, aNode, bNode);
}
Example #15
0
void
FEI3dHexaLin :: computeLocalSurfaceMapping(IntArray &surfNodes, int isurf)
{
    int aNode = 0, bNode = 0, cNode = 0, dNode = 0;

    if ( isurf == 1 ) { // surface 1 - nodes 1 4 3 2
        aNode = 1;
        bNode = 4;
        cNode = 3;
        dNode = 2;
    } else if ( isurf == 2 ) { // surface 2 - nodes 5 6 7 8
        aNode = 5;
        bNode = 6;
        cNode = 7;
        dNode = 8;
    } else if ( isurf == 3 ) { // surface 3  - nodes 1 2 6 5
        aNode = 1;
        bNode = 2;
        cNode = 6;
        dNode = 5;
    } else if ( isurf == 4 ) { // surface 4 - nodes 2 3 7 6
        aNode = 2;
        bNode = 3;
        cNode = 7;
        dNode = 6;
    } else if ( isurf == 5 ) { // surface 5 - nodes 3 4 8 7
        aNode = 3;
        bNode = 4;
        cNode = 8;
        dNode = 7;
    } else if ( isurf == 6 ) { // surface 6 - nodes 4 1 5 8
        aNode = 4;
        bNode = 1;
        cNode = 5;
        dNode = 8;
    } else {
        OOFEM_ERROR2("FEI3dHexaLin :: computeSurfaceMapping: wrong surface number (%d)", isurf);
    }

    surfNodes.setValues(4, aNode, bNode, cNode, dNode);
}
Example #16
0
void Tr21Stokes :: EIPrimaryUnknownMI_givePrimaryUnknownVectorDofID(IntArray &answer)
{
    answer.setValues(3, V_u, V_v, P_f);
}
void LineSurfaceTension :: EIPrimaryUnknownMI_givePrimaryUnknownVectorDofID(IntArray &answer)
{
    answer.setValues(2, V_u, V_v);
}
void
TrPlanestressRotAllman :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(3, D_u, D_v, R_w);
}
Example #19
0
void
LIBeam3dNL :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(6, D_u, D_v, D_w, R_u, R_v, R_w);
}
Example #20
0
void
L4Axisymm :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(2, D_u, D_v);
}
void
Quad1MindlinShell3D :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(6, D_u, D_v, D_w, R_u, R_v, R_w);
}
void
TrPlaneStrRot3d :: giveDofManDofIDMask(int inode, EquationID ut, IntArray &answer) const
{
    answer.setValues(6, D_u, D_v, D_w, R_u, R_v, R_w);
}
Example #23
0
void
QTrPlaneStrain ::   giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(2, D_u, D_v);
}
Example #24
0
void
Truss3d :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(3, D_u, D_v, D_w);
}
Example #25
0
void
LEPlic :: doLagrangianPhase(TimeStep *atTime)
{
    //Maps element nodes along trajectories using basic Runge-Kutta method (midpoint rule)
    int i, ci, ndofman = domain->giveNumberOfDofManagers();
    int nsd = 2;
    double dt = atTime->giveTimeIncrement();
    DofManager *dman;
    Node *inode;
    IntArray velocityMask;
    FloatArray x, x2(nsd), v_t, v_tn1;
    FloatMatrix t;
#if 1
    EngngModel *emodel = domain->giveEngngModel();
    int err;
#endif
    velocityMask.setValues(2, V_u, V_v);

    updated_XCoords.resize(ndofman);
    updated_YCoords.resize(ndofman);


    for ( i = 1; i <= ndofman; i++ ) {
        dman = domain->giveDofManager(i);
        // skip dofmanagers with no position information
        if ( ( dman->giveClassID() != NodeClass ) && ( dman->giveClassID() != RigidArmNodeClass ) && ( dman->giveClassID() != HangingNodeClass ) ) {
            continue;
        }

        inode = ( Node * ) dman;
        // get node coordinates
        x = * ( inode->giveCoordinates() );
        // get velocity field v(tn, x(tn)) for dof manager

#if 1
        /* Original version */
        dman->giveUnknownVector( v_t, velocityMask, EID_MomentumBalance, VM_Total, atTime->givePreviousStep() );
        /* Modified version */
        //dman->giveUnknownVector(v_t, velocityMask, EID_MomentumBalance, VM_Total, atTime);

        // Original version
        // compute updated position x(tn)+0.5*dt*v(tn,x(tn))
        for ( ci = 1; ci <= nsd; ci++ ) {
            x2.at(ci) = x.at(ci) + 0.5 *dt *v_t.at(ci);
        }

        // compute interpolated velocity field at x2 [ v(tn+1, x(tn)+0.5*dt*v(tn,x(tn))) = v(tn+1, x2) ]
        Field *vfield;
        vfield = emodel->giveContext()->giveFieldManager()->giveField(FT_Velocity);
        if ( vfield == NULL ) {
            _error("doLagrangianPhase: Velocity field not available");
        }

        err = vfield->evaluateAt(v_tn1, x2, VM_Total, atTime);
        if ( err == 1 ) {
            // point outside domain -> be explicit
            v_tn1 = v_t;
        } else if ( err != 0 ) {
            _error2("doLagrangianPhase: vfield->evaluateAt failed, error code %d", err);
        }

        // compute final updated position
        for ( ci = 1; ci <= nsd; ci++ ) {
            x2.at(ci) = x.at(ci) + dt *v_tn1.at(ci);
        }

#else
        // pure explicit version
        dman->giveUnknownVector(v_t, velocityMask, EID_MomentumBalance, VM_Total, atTime);

        for ( ci = 1; ci <= nsd; ci++ ) {
            x2.at(ci) = x.at(ci) + dt *v_t.at(ci);
        }

#endif
        // store updated node position
        updated_XCoords.at(i) = x2.at(1);
        updated_YCoords.at(i) = x2.at(2);
    }
}
Example #26
0
void
Quad1Mindlin :: giveDofManDofIDMask(int inode, EquationID, IntArray &answer) const
{
    answer.setValues(3, D_w, R_u, R_v);
}