Exemple #1
0
//************************************************************************************
//************************************************************************************
void MeshlessLagrangeCouplingCondition::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
	KRATOS_TRY
	unsigned int number_of_nodes = GetGeometry().size();
	unsigned int number_of_dofs = number_of_nodes * 6;

	if (rResult.size() != number_of_dofs)
		rResult.resize(number_of_dofs);

	for (int i = 0; i < number_of_nodes; i++)
	{
		int index = 3 * i;
		rResult[index]	   = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
		rResult[index + 1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();
		rResult[index + 2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId();
	}
	for (int i = 0; i<number_of_nodes; i++)
	{
		int index = 3 * i + 3 * number_of_nodes;
		rResult[index]     = GetGeometry()[i].GetDof(VECTOR_LAGRANGE_MULTIPLIER_X).EquationId();
		rResult[index + 1] = GetGeometry()[i].GetDof(VECTOR_LAGRANGE_MULTIPLIER_Y).EquationId();
		rResult[index + 2] = GetGeometry()[i].GetDof(VECTOR_LAGRANGE_MULTIPLIER_Z).EquationId();
	}

	KRATOS_CATCH("")
}
//************************************************************************************
//************************************************************************************
void Electrostatic2D::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
    unsigned int number_of_nodes = GetGeometry().PointsNumber();
    if(rResult.size() != number_of_nodes)
        rResult.resize(number_of_nodes,false);

    for (unsigned int i=0; i<number_of_nodes; i++)
        rResult[i] = GetGeometry()[i].GetDof(ELECTROSTATIC_POTENTIAL).EquationId();
}
//***********************************************************************************
void FaceHeatConvection::EquationIdVector( EquationIdVectorType& rResult, ProcessInfo& rCurrentProcessInfo )
{
    KRATOS_TRY
    unsigned int number_of_nodes = GetGeometry().size();
    if ( rResult.size() != number_of_nodes )
        rResult.resize( number_of_nodes );

    for ( unsigned int i = 0;i < number_of_nodes;i++ )
        rResult[i] = GetGeometry()[i].GetDof( TEMPERATURE ).EquationId();
    KRATOS_CATCH( "" )
}
Exemple #4
0
//************************************************************************************
//************************************************************************************
void ThermalFace2D::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
    ConvectionDiffusionSettings::Pointer my_settings = CurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
    const Variable<double>& rUnknownVar = my_settings->GetUnknownVariable();

    unsigned int number_of_nodes = GetGeometry().PointsNumber();
    if(rResult.size() != number_of_nodes)
        rResult.resize(number_of_nodes,false);
    for (unsigned int i=0; i<number_of_nodes; i++)
    {
        rResult[i] = (GetGeometry()[i].GetDof(rUnknownVar)).EquationId();
    }
}
void PeriodicConditionLM2D2N::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
	if(rResult.size() != 6) rResult.resize(6);
	GeometryType& geom = GetGeometry();
	
	rResult[0] = geom[0].GetDof( DISPLACEMENT_X ).EquationId();
	rResult[1] = geom[0].GetDof( DISPLACEMENT_Y ).EquationId();
	
	rResult[2] = geom[1].GetDof( DISPLACEMENT_X ).EquationId();
	rResult[3] = geom[1].GetDof( DISPLACEMENT_Y ).EquationId();
	
	rResult[4] = geom[0].GetDof( DISPLACEMENT_LAGRANGE_X ).EquationId();
	rResult[5] = geom[0].GetDof( DISPLACEMENT_LAGRANGE_Y ).EquationId();
}
//************************************************************************************
//************************************************************************************
void UpdatedLagrangianFluid3Dinc::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
    unsigned int number_of_nodes = GetGeometry().PointsNumber();
    unsigned int dim = 3;

    if(rResult.size() != number_of_nodes*dim)
        rResult.resize(number_of_nodes*dim,false);

    for (unsigned int i=0; i<number_of_nodes; i++)
    {
        rResult[i*dim] = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
        rResult[i*dim+1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();
        rResult[i*dim+2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId();
    }

}
Exemple #7
0
//***********************************************************************************
//***********************************************************************************
void LineForce::EquationIdVector( EquationIdVectorType& rResult,
                                    ProcessInfo& rCurrentProcessInfo )
{
    KRATOS_TRY

    DofsVectorType ConditionalDofList;
    GetDofList(ConditionalDofList, rCurrentProcessInfo);

    if (rResult.size() != ConditionalDofList.size())
        rResult.resize(ConditionalDofList.size(), false);

    for(unsigned int i = 0; i < ConditionalDofList.size(); ++i)
    {
        rResult[i] = ConditionalDofList[i]->EquationId();
    }

    KRATOS_CATCH( "" )
}
/**
 * REMOVED: the DOFs are managed by the linking conditions
 */
void MasterContactPoint2D::EquationIdVector( EquationIdVectorType& rResult,
        ProcessInfo& CurrentProcessInfo
                                           )
{

    KRATOS_TRY
    unsigned int number_of_nodes = GetGeometry().size();
    unsigned int dim = number_of_nodes*2;
    if(rResult.size() != dim)
        rResult.resize(dim);

    for (unsigned int i=0; i<number_of_nodes; i++)
    {
        int index = i*2;
        rResult[index]   = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
        rResult[index+1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();
    }
    KRATOS_CATCH("")
}
//************************************************************************************
//************************************************************************************
void NDFluid2DCrankNicolson::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
    unsigned int number_of_nodes = GetGeometry().PointsNumber();
    if(rResult.size() != number_of_nodes)
        rResult.resize(number_of_nodes,false);

    unsigned int FractionalStepNumber = CurrentProcessInfo[FRACTIONAL_STEP];

    if(FractionalStepNumber == 1) //step 1
        for (unsigned int i=0; i<number_of_nodes; i++)
            rResult[i] = GetGeometry()[i].GetDof(FRACT_VEL_X).EquationId();
    else if(FractionalStepNumber == 2) //step 2
        for (unsigned int i=0; i<number_of_nodes; i++)
            rResult[i] = GetGeometry()[i].GetDof(FRACT_VEL_Y).EquationId();

    else if(FractionalStepNumber == 4) // pressure correction step
        for (unsigned int i=0; i<number_of_nodes; i++)
            rResult[i] = GetGeometry()[i].GetDof(PRESSURE).EquationId();
}
//************************************************************************************
//************************************************************************************
void Monolithic2DNeumann::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
    KRATOS_TRY
    unsigned int number_of_nodes = GetGeometry().PointsNumber();
    unsigned int dim = 2;
    unsigned int node_size = dim;


    if(rResult.size() != number_of_nodes*node_size)
        rResult.resize(number_of_nodes*node_size,false);

    for (unsigned int i=0; i<number_of_nodes; i++)
    {
        rResult[i*node_size] = GetGeometry()[i].GetDof(VELOCITY_X).EquationId();
        rResult[i*node_size+1] = GetGeometry()[i].GetDof(VELOCITY_Y).EquationId();

    }
    KRATOS_CATCH("")

}
Exemple #11
0
void BeamElement::EquationIdVector(EquationIdVectorType& rResult,
                                   ProcessInfo& CurrentProcessInfo)
{
    if(rResult.size() != 12)
        rResult.resize(12,false);



    rResult[0]	= GetGeometry()[0].GetDof(DISPLACEMENT_X).EquationId();
    rResult[1]	= GetGeometry()[0].GetDof(DISPLACEMENT_Y).EquationId();
    rResult[2]	= GetGeometry()[0].GetDof(DISPLACEMENT_Z).EquationId();
    rResult[3]	= GetGeometry()[0].GetDof(ROTATION_X).EquationId();
    rResult[4]	= GetGeometry()[0].GetDof(ROTATION_Y).EquationId();
    rResult[5]	= GetGeometry()[0].GetDof(ROTATION_Z).EquationId();
    rResult[6]	= GetGeometry()[1].GetDof(DISPLACEMENT_X).EquationId();
    rResult[7]	= GetGeometry()[1].GetDof(DISPLACEMENT_Y).EquationId();
    rResult[8]	= GetGeometry()[1].GetDof(DISPLACEMENT_Z).EquationId();
    rResult[9]	= GetGeometry()[1].GetDof(ROTATION_X).EquationId();
    rResult[10] = GetGeometry()[1].GetDof(ROTATION_Y).EquationId();
    rResult[11] = GetGeometry()[1].GetDof(ROTATION_Z).EquationId();

}
void BeamPointPressureCondition::EquationIdVector(EquationIdVectorType& rResult,
					  ProcessInfo& rCurrentProcessInfo)
{
    KRATOS_TRY

    const unsigned int number_of_nodes = GetGeometry().PointsNumber();
    const unsigned int dimension       = GetGeometry().WorkingSpaceDimension();
    unsigned int condition_size        = number_of_nodes * (dimension * (dimension-1));

    if (rResult.size() != condition_size)
      rResult.resize( condition_size, false );

    for (unsigned int i = 0; i < number_of_nodes; i++) //TODO: fix this. Apparently, it would not work in 2D!! MA
    {
        int index = i * (dimension * (dimension-1));
        rResult[index]     = GetGeometry()[i].GetDof(DISPLACEMENT_X).EquationId();
        rResult[index + 1] = GetGeometry()[i].GetDof(DISPLACEMENT_Y).EquationId();

	if( dimension == 3){
	  rResult[index + 2] = GetGeometry()[i].GetDof(DISPLACEMENT_Z).EquationId();
	  rResult[index + 3] = GetGeometry()[i].GetDof(ROTATION_X).EquationId();
          rResult[index + 4] = GetGeometry()[i].GetDof(ROTATION_Y).EquationId();
	}
	
	rResult[index + 5] = GetGeometry()[i].GetDof(ROTATION_Z).EquationId();
    }
    
//    std::cout<<" Pressure condition "<<std::endl;
//     for ( unsigned int i = 0; i < number_of_nodes; i++ )
//       {
//     	unsigned int index = i * ( dimension * 2 );
//     	for ( unsigned int j = index; j <= (index+5); j ++ )
//     	  std::cout<<rResult[j]<<" ";
//        std::cout<<std::endl;
//       }

    KRATOS_CATCH( "" )
}
void TwoStepPeriodicCondition<TDim>::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& rCurrentProcessInfo)
{
    rResult.resize(0);
}