Exemplo n.º 1
0
int EpetraVector<T>::ReplaceGlobalValues(const Epetra_IntSerialDenseVector & GIDs,
                                         const Epetra_SerialDenseVector & values)
{
  if (GIDs.Length() != values.Length()) {
    return(-1);
  }

  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), false) );
}
Exemplo n.º 2
0
int Epetra_FEVector::SumIntoGlobalValues(const Epetra_IntSerialDenseVector& GIDs,
                       const Epetra_SerialDenseVector& values,
                                         int vectorIndex)
{
  if (GIDs.Length() != values.Length()) {
    return(-1);
  }

  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), true,
                       vectorIndex ) );
}
Exemplo n.º 3
0
int Epetra_FEVector::ReplaceGlobalValues(const Epetra_LongLongSerialDenseVector& GIDs,
                       const Epetra_SerialDenseVector& values,
                                         int vectorIndex)
{
  if (GIDs.Length() != values.Length()) {
    return(-1);
  }

  return( inputValues( GIDs.Length(), GIDs.Values(), values.Values(), false,
                       vectorIndex) );
}
Exemplo n.º 4
0
//=========================================================================
double  Epetra_SerialDenseVector::Dot(const Epetra_SerialDenseVector & x) const {

#ifdef HAVE_EPETRA_ARRAY_BOUNDS_CHECK
  if (Length()!=x.Length())
    throw ReportError("Length of this object = " +
		      toString(Length()) + " is not equal to length of x = "  + toString(x.Length()), -1);
#endif

  // dot-product of this and x.

  double result = DOT(Length(), Values(), x.Values());

  UpdateFlops(2*Length());

  return(result);
}
Exemplo n.º 5
0
void FlowConditions::renewParameters ( FSISolver&  oper_,
                                       const int&    outflowFlag,
                                       const FSIOperator::vector_Type& fluidSolution)
{

    Epetra_SerialDenseVector fluidQuantities (2); // Flux and Area
    //Epetra_SerialDenseVector solidQuantities(0); // M_beta and M_rhos
    FSIOperator* Oper (oper_.FSIOper().get() );

    if (Oper->isFluid() )
    {
        fluidQuantities (0) = Oper->fluid().flux (outflowFlag, fluidSolution );
        fluidQuantities (1) = Oper->fluid().area (outflowFlag);
    }

    Oper->worldComm()->Broadcast ( fluidQuantities.Values(), fluidQuantities.Length(),
                                   Oper->getFluidLeaderId() );


    Real qn;
    Real area;
    Real area0;

    qn   = fluidQuantities (0);
    area = fluidQuantities (1);
    area0 = 0.0034212;
    // Fluid density
    // Real density = 1.0;
    UInt flag   = 1;

    // Setting parameters for our simulation:
    // if imposing the absorbing boundary condition through the pressure:
    if (bcOnFluid)
    {

        // Moura et al.
        //Alexandra's Abc
        Real exp  = 5 / 4;
        Real beta = ( std::sqrt (PI) * Oper->solid().thickness() * Oper->solid().young ( flag ) ) / (1 - Oper->solid().poisson ( flag ) * Oper->solid().poisson ( flag ) );
        Real R    = ( std::sqrt (Oper->solid().rho( ) * beta ) ) / ( std::sqrt (2.0) * std::pow (area0, exp) );

        M_outP       = R * qn;

        // Nobile & Vergara
        // M_outP =  pow((sqrt(density)/(2.*sqrt(2))*qn/area + sqrt(M_beta*sqrt(M_area0))),2)
        //           - M_beta*sqrt(M_area0);
        FlowConditions::outputVector[conditionNumber] = M_outP;

        Oper->displayer().leaderPrint ( " Flow rate = " , qn );
        Oper->displayer().leaderPrint ( " outflow pressure   = " , M_outP );

        M_outDeltaRadius = 0;


    }
    else
    {
        // if imposing the absorbing boundary condition through change in radius: --> Not ready
#ifdef  TESTING
        M_outP = Pout;

        area = qn * std::sqrt (M_rhos) / ( (2.*std::sqrt (2) ) *
                                           std::sqrt ( M_outP + M_beta * sqrt (M_area0) ) - std::sqrt ( M_beta * sqrt (M_area0) ) );

        assert (area >= 0 );
        if (area < 1e-8 * M_area0)
        {
            area = M_area0;
        }

        M_outDeltaRadius = std::sqrt ( area / pi  ) - M_outRadius0;

        Oper->displayer().leaderPrint ( " outflow A = " , area );
        Oper->displayer().leaderPrint ( " outflow dr = " , M_outDeltaRadius );
        Oper->displayer().leaderPrint ( " Flow rate = " , qn );
        Oper->displayer().leaderPrint ( " outflow pressure   = " , M_outP );
#endif

    }

    // for now applying absBC only at outflow
    M_inDeltaRadius = 0;
    //    M_inP = Pin;

}