Version: 6.3.1
Data Structures | Functions

src/StdMeshers/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>
Include dependency graph for StdMeshers_Distribution.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  Function
class  FunctionIntegral
class  FunctionTable
class  FunctionExpr

Functions

bool buildDistribution (const Function &f, const double start, const double end, const int nbSeg, std::vector< double > &data, const double eps)
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)
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

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.

References dihotomySolve(), and Function.integral().

{
  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;
}
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.

References buildDistribution().

{
  FunctionTable F( f, conv );
  return buildDistribution( F, start, end, nbSeg, data, eps );
}
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 
)
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS