Back to index

salome-smesh  6.5.0
Classes | Functions
StdMeshers_Distribution.hxx File Reference
#include "SMESH_StdMeshers.hxx"
#include <vector>
#include <math_Function.hxx>
#include <ExprIntrp_GenExp.hxx>
#include <Expr_Array1OfNamedUnknown.hxx>
#include <TColStd_Array1OfReal.hxx>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

protocol  STDMESHERS_EXPORT
 1D Hypothesis to compute segment length free of thinking More...
protocol  STDMESHERS_EXPORT
 1D Hypothesis to compute segment length free of thinking More...
protocol  STDMESHERS_EXPORT
 1D Hypothesis to compute segment length free of thinking More...
protocol  STDMESHERS_EXPORT
 1D Hypothesis to compute segment length free of thinking More...

Functions

STDMESHERS_EXPORT bool buildDistribution (const Function &f, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps)
STDMESHERS_EXPORT bool buildDistribution (const TCollection_AsciiString &f, const int conv, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps)
STDMESHERS_EXPORT bool buildDistribution (const std::vector< double > &f, const int conv, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps)

Function Documentation

STDMESHERS_EXPORT bool buildDistribution ( const Function &  f,
const double  start,
const double  end,
const int  nbSeg,
std::vector< double > &  data,
const double  eps 
)

Definition at line 320 of file StdMeshers_Distribution.cxx.

{
  if( nbSeg<=0 )
    return false;

  data.resize( nbSeg+1 );
  data[0] = start;
  double J = func.integral( start, end ) / nbSeg;
  if( J<1E-10 )
    return false;

  bool ok;
  //MESSAGE( "distribution:" );
  //char buf[1024];
  for( int i=1; i<nbSeg; i++ )
  {
    FunctionIntegral f_int( &func, data[i-1] );
    data[i] = dihotomySolve( f_int, J, data[i-1], end, eps, ok );
    //sprintf( buf, "%f\n", float( data[i] ) );
    //MESSAGE( buf );
    if( !ok )
      return false;
  }

  data[nbSeg] = end;
  return true;
}

Here is the call graph for this function:

STDMESHERS_EXPORT bool buildDistribution ( const TCollection_AsciiString &  f,
const int  conv,
const double  start,
const double  end,
const int  nbSeg,
std::vector< double > &  data,
const double  eps 
)

Definition at line 306 of file StdMeshers_Distribution.cxx.

{
  FunctionExpr F( f.ToCString(), conv );
  return buildDistribution( F, start, end, nbSeg, data, eps );
}

Here is the call graph for this function:

Here is the caller graph for this function:

STDMESHERS_EXPORT bool buildDistribution ( const std::vector< double > &  f,
const int  conv,
const double  start,
const double  end,
const int  nbSeg,
std::vector< double > &  data,
const double  eps 
)

Definition at line 313 of file StdMeshers_Distribution.cxx.

{
  FunctionTable F( f, conv );
  return buildDistribution( F, start, end, nbSeg, data, eps );
}

Here is the call graph for this function: