Пример #1
0
void peano::applications::faxen::mappings::RegularGrid2Initialize::createBoundaryVertex(
		const tarch::la::Vector<DIMENSIONS,double>&  x,
		const tarch::la::Vector<DIMENSIONS,double>&  h,
		peano::applications::faxen::RegularGridVertex&  vertex
) {
	logTraceInWith3Arguments( "createBoundaryVertex()", x, h, vertex );
	vertex.init();
	logTraceOutWith1Argument( "createBoundaryVertex()", vertex );
}
Пример #2
0
void peano::applications::navierstokes::prototype1::mappings::RegularGrid2MergeF::createBoundaryVertex(
  const tarch::la::Vector<DIMENSIONS,double>&  x,
  const tarch::la::Vector<DIMENSIONS,double>&  h,
  peano::applications::navierstokes::prototype1::RegularGridFluidVertexEnhancedDivFreeEulerExplicit&  vertex
) {
  logTraceInWith3Arguments( "createBoundaryVertex()", x, h, vertex );
  // @todo Insert your code here
  logTraceOutWith1Argument( "createBoundaryVertex()", vertex );
}
Пример #3
0
void peano::applications::navierstokes::prototype1::mappings::RegularGrid2MergeF::createCell(
  peano::applications::navierstokes::prototype1::RegularGridFluidVertexEnhancedDivFreeEulerExplicit const * const vertices,
  peano::applications::navierstokes::prototype1::RegularGridFluidCellEnhancedDivFreeEulerExplicit&  cell,
  const peano::kernel::gridinterface::VertexEnumerator&  enumerator
) {
  logTraceInWith2Arguments( "createCell()", enumerator.toString(), cell );
  // @todo Insert your code here
  logTraceOutWith1Argument( "createCell()", cell );
}
void peano::applications::faxen::lbf::mappings::RegularGrid2ControlTimeStep::createBoundaryVertex(
		const tarch::la::Vector<DIMENSIONS,double>&  x,
		const tarch::la::Vector<DIMENSIONS,double>&  h,
		peano::applications::faxen::lbf::RegularGridBlockVertex&  vertex
) {
	logTraceInWith3Arguments( "createBoundaryVertex()", x, h, vertex );
	// @todo Insert your code here
	logTraceOutWith1Argument( "createBoundaryVertex()", vertex );
}
void peano::applications::faxen::lbf::mappings::RegularGrid2ControlTimeStep::createCell(
		peano::applications::faxen::lbf::RegularGridBlockVertex const * const vertices,
		peano::applications::faxen::lbf::RegularGridBlockCell&  cell,
		const peano::kernel::gridinterface::VertexEnumerator&  enumerator
) {
	logTraceInWith2Arguments( "createCell()", enumerator.toString(), cell );
	// @todo Insert your code here
	logTraceOutWith1Argument( "createCell()", cell );
}
void peano::applications::faxen::mappings::RegularGrid2ComputeVelocities::createInnerVertex(
  const tarch::la::Vector<DIMENSIONS,double>&  x,
  const tarch::la::Vector<DIMENSIONS,double>&  h,
  peano::applications::faxen::RegularGridVertex&  vertex
) {
  logTraceInWith3Arguments( "createInnerVertex()", x, h, vertex );
  // @todo Insert your code here
  logTraceOutWith1Argument( "createInnerVertex()", vertex );
}
void peano::applications::faxen::lbf::mappings::RegularGrid2BlockVTKOutput::createBoundaryVertex(
		const tarch::la::Vector<DIMENSIONS,double>&  x,
		const tarch::la::Vector<DIMENSIONS,double>&  h,
		peano::applications::faxen::lbf::RegularGridBlockVertex&  vertex
) {
	logTraceInWith3Arguments( "createBoundaryVertex()", x, h, vertex );
	vertex.createVertex(x,h);
	logTraceOutWith1Argument( "createBoundaryVertex()", vertex );
}
void peano::applications::pic::demo2::mappings::RegularGrid2PlotSolution::createBoundaryVertex(
  const tarch::la::Vector<DIMENSIONS,double>&  x,
  const tarch::la::Vector<DIMENSIONS,double>&  h,
  peano::applications::pic::demo2::RegularGridVertex&  vertex
) {
  logTraceInWith3Arguments( "createBoundaryVertex()", x, h, vertex );
  // @todo Insert your code here
  plotVertex( vertex, x );
  logTraceOutWith1Argument( "createBoundaryVertex()", vertex );
}
void peano::applications::faxen::lbf::mappings::RegularGrid2ComputeRightHandSide::beginIteration(
		peano::applications::faxen::lbf::RegularGridBlockState&  solverState
) {
	logTraceInWith1Argument( "beginIteration()", solverState );

	_dx = solverState.getDelx();
	_dy = solverState.getDely();
	_dt = solverState.getDelt();
	logTraceOutWith1Argument( "beginIteration()", solverState );
}
void peano::applications::navierstokes::prototype1::mappings::RegularGrid2InitialiseScenario::touchVertexFirstTime(
  peano::applications::navierstokes::prototype1::RegularGridFluidVertexEnhancedDivFreeEulerExplicit&  vertex,
  const tarch::la::Vector<DIMENSIONS,double>&  x
) {
  logTraceInWith2Arguments( "touchVertexFirstTime()", x, vertex );

  _calculateA->handleVertex(vertex);

  logTraceOutWith1Argument( "touchVertexFirstTime()", vertex );
}
void peano::applications::heatequation::timestepping::mappings::SpacetreeGrid2ComputeImplicitSolutionWithJacobi::beginIteration(
  peano::applications::heatequation::timestepping::SpacetreeGridState&  solverState
) {
  logTraceInWith1Argument( "beginIteration(State)", solverState );

  _solver.clearMeasurements();
  _solver.setTimeStepSize(solverState.getTimeStepSize());
  _solver.setOmega( solverState.getRelaxationFactor() );

  logTraceOutWith1Argument( "beginIteration(State)", solverState);
}
Пример #12
0
void peano::applications::faxen::mappings::RegularGrid2SORStep::beginIteration(
  peano::applications::faxen::RegularGridState&  solverState
) {
  logTraceInWith1Argument( "beginIteration()", solverState );

  _omega = solverState.getRelaxationFactor();
  _dx = solverState.getDelx();
  _dy = solverState.getDely();

  logTraceOutWith1Argument( "beginIteration()", solverState );
}
Пример #13
0
void peanoclaw::mappings::Cleanup::mergeWithWorker(
    peanoclaw::Vertex&        localVertex,
    const peanoclaw::Vertex&  receivedMasterVertex,
    const tarch::la::Vector<DIMENSIONS,double>&   x,
    const tarch::la::Vector<DIMENSIONS,double>&   h,
    int                                           level
) {
    logTraceInWith2Arguments( "mergeWithWorker(...)", localVertex.toString(), receivedMasterVertex.toString() );
    // @todo Insert your code here
    logTraceOutWith1Argument( "mergeWithWorker(...)", localVertex.toString() );
}
Пример #14
0
void particles::pidt::mappings::MoveParticles::beginIteration(
  particles::pidt::State&  solverState
) {
  logTraceInWith1Argument( "beginIteration(State)", solverState );

  _state = solverState;
  _state.clearStatistics();
  ParticleHeap::getInstance().startToSendBoundaryData(solverState.isTraversalInverted());

  logTraceOutWith1Argument( "beginIteration(State)", solverState);
}
Пример #15
0
double scenario::diffusionequation::CornerPointField::getThermalDiffusivity(const tarch::la::Vector<2,double>& x) {
  logTraceInWith1Argument( "getThermalDiffusivity(x)", x );
  if (_hexahedron.isOutsideClosedDomain(x)) {
    logTraceOutWith1Argument( "getThermalDiffusivity(x)", 0.0 );
    return 0.0;
  }
  #ifdef Dim2
  tarch::la::Vector<3,double> probe;
  probe(0) = x(0);
  probe(1) = 0.0;
  probe(2) = x(1);
  double result = getPorosityFromDataSet(probe);
  logTraceOutWith1Argument( "getThermalDiffusivity(x)", result );
  return result;
  #else
  assertionMsg( false, "not implemented yet");
  logTraceOutWith1Argument( "getThermalDiffusivity(x)", 0.0 );
  return 0.0;
  #endif
}
Пример #16
0
void peano::applications::poisson::jacobitutorial::mappings::RegularGrid2PlotSolution::endIteration(
  peano::applications::poisson::jacobitutorial::RegularGridState&  solverState
) {
  logTraceInWith1Argument( "endIteration()", solverState );

  /**
   * --- inserted manually ---
   *
   * Whenever we startup a plotter iteration, we take the output file name and
   * add a counter. The counter is stored in the state as we have to keep track
   * of it throughout the whole program execution, and mappings should not have
   * a persistent state themselves.
   */
  std::ostringstream newFilename;
  newFilename << "jacobi-solution-on-regular-grid-"
              << solverState.getFilenameCounterAndIncrementIt()
              << ".vtk";

  /**
   * --- inserted manually ---
   *
   * Close the data writers, pipe the data to a file, and destroy all the
   * objects we won't need anymore. This is again technical stuff.
   */
  _vertexWriter->close();
  _cellWriter->close();

  _vertexResidualWriter->close();
  _vertexValueWriter->close();
  _vertexRhsWriter->close();

  delete _vertexWriter;
  delete _cellWriter;
  delete _vertexResidualWriter;
  delete _vertexValueWriter;
  delete _vertexRhsWriter;

  _vertexWriter         = 0;
  _cellWriter           = 0;
  _vertexResidualWriter = 0;
  _vertexValueWriter    = 0;
  _vertexRhsWriter      = 0;

  _vtkWriter.writeToFile( newFilename.str() );

  /**
   * --- inserted manually ---
   *
   * Lets finally tell the user that we've created a file.
   */
  logInfo( "endIteration()", "wrote solution to " << newFilename.str() );

  logTraceOutWith1Argument( "endIteration()", solverState );
}
void peano::applications::navierstokes::prototype1::mappings::RegularGrid2InitialiseScenario::createCell(
  peano::applications::navierstokes::prototype1::RegularGridFluidVertexEnhancedDivFreeEulerExplicit const * const vertices,
  peano::applications::navierstokes::prototype1::RegularGridFluidCellEnhancedDivFreeEulerExplicit&  cell,
  const peano::kernel::gridinterface::VertexEnumerator&  enumerator
) {
  logTraceInWith2Arguments( "createCell()", enumerator.toString(), cell );

  cell.setFluidCellType(RegularGridFluidCellEnhancedDivFreeEulerExplicit::Records::INNER);

  logTraceOutWith1Argument( "createCell()", cell );
}
void peano::applications::navierstokes::prototype1::mappings::RegularGrid2InitialiseScenario::createBoundaryVertex(
  const tarch::la::Vector<DIMENSIONS,double>&  x,
  const tarch::la::Vector<DIMENSIONS,double>&  h,
  peano::applications::navierstokes::prototype1::RegularGridFluidVertexEnhancedDivFreeEulerExplicit&  vertex
) {
  logTraceInWith3Arguments( "createBoundaryVertex()", x, h, vertex );

  _scenarioHandler->initialiseBoundaryVertex(x, vertex);

  logTraceOutWith1Argument( "createBoundaryVertex()", vertex );
}
void peano::applications::navierstokes::prototype1::mappings::RegularGrid2UpdateVelocity::beginIteration(
  peano::applications::navierstokes::prototype1::RegularGridFluidStateEnhancedDivFreeEulerExplicit&  solverState
) {
  logTraceInWith1Argument( "beginIteration()", solverState );

  _tau = solverState.getOdeTau();
  _elementType = solverState.getElementType();

  _log.info("beginIteration()","start iteration for UpdateVelocity mapping ...");
  logTraceOutWith1Argument( "beginIteration()", solverState );
}
Пример #20
0
void particles::pidt::mappings::MoveParticles::enterCell(
  particles::pidt::Cell&                    fineGridCell,
  particles::pidt::Vertex * const           fineGridVertices,
  const peano::grid::VertexEnumerator&      fineGridVerticesEnumerator,
  particles::pidt::Vertex * const           coarseGridVertices,
  const peano::grid::VertexEnumerator&      coarseGridVerticesEnumerator,
  particles::pidt::Cell&                    coarseGridCell,
  const tarch::la::Vector<DIMENSIONS,int>&  fineGridPositionOfCell
) {
  logTraceInWith4Arguments( "enterCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );

  if (fineGridCell.isRefined()) {
    fineGridCell.clearMaxVComponent();
  }
  else {
    #if defined(SharedTBB) && !defined(__WIN32__)
    tbb::atomic<int>     numberOfParticlesMoved;
    #elif defined(SharedTBB) && defined(__WIN32__)
    static tarch::multicore::BooleanSemaphore  semaphore;
    int    numberOfParticlesMoved;
    #elif SharedOMP
      #error not implemented yet
    #else
    int    numberOfParticlesMoved;
    #endif
    numberOfParticlesMoved = 0;

    pdfor2(k)
      const int sourceVertexIndex = fineGridVertices[ fineGridVerticesEnumerator(k) ].getVertexIndex();

      #ifdef MOVE_USES_SORTED_PARTICLES
      const int resultOfOneVertex = moveParticlesOfOneVertexWithinCellIfTheyAreSorted(
        sourceVertexIndex,
        fineGridVerticesEnumerator
      );
      #else
      const int resultOfOneVertex = moveParticlesOfOneVertexWithinCell(
        sourceVertexIndex,
        fineGridVerticesEnumerator
      );
      #endif

      #if defined(SharedTBB) && defined(__WIN32__)
      tarch::multicore::Lock lock(semaphore);
      #endif
      numberOfParticlesMoved += resultOfOneVertex;
    endpdforx

    _state.updateParticleStatisticsInLeaf(numberOfParticlesMoved,fineGridVerticesEnumerator.getCellSize());
  }

  logTraceOutWith1Argument( "enterCell(...)", fineGridCell );
}
void peano::applications::pic::demo2::mappings::SpacetreeGrid2PlotSolution::beginIteration(
  peano::applications::pic::demo2::SpacetreeGridState&  solverState
) {
  logTraceInWith1Argument( "beginIteration(State)", solverState );
  _vtkWriter.clear();

   _vertexWriter     = _vtkWriter.createVertexWriter();
   _cellWriter       = _vtkWriter.createCellWriter();

   _cellPWriter  = _vtkWriter.createCellDataWriter( "p" ,1);
  logTraceOutWith1Argument( "beginIteration(State)", solverState);
}
void peano::applications::poisson::multigrid::mappings::SpacetreeGrid2PlotSolution::destroyVertex(
  const peano::applications::poisson::multigrid::SpacetreeGridVertex&   fineGridVertex,
  const tarch::la::Vector<DIMENSIONS,double>&                    fineGridX,
  const tarch::la::Vector<DIMENSIONS,double>&                    fineGridH,
  peano::applications::poisson::multigrid::SpacetreeGridVertex const * const  coarseGridVertices,
  const peano::kernel::gridinterface::VertexEnumerator&          coarseGridVerticesEnumerator,
  const peano::applications::poisson::multigrid::SpacetreeGridCell&           coarseGridCell,
  const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfVertex
) {
  logTraceInWith6Arguments( "destroyVertex(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );
  logTraceOutWith1Argument( "destroyVertex(...)", fineGridVertex );
}
Пример #23
0
void particles::pidt::mappings::MoveParticles::endIteration(
  particles::pidt::State&  solverState
) {
  logTraceInWith1Argument( "endIteration(State)", solverState );

  logInfo( "endIteration(State)", "particles-local=" << _state.getNumberOfParticles() );

  solverState.reduceStateStatistics( _state );
  ParticleHeap::getInstance().finishedToSendBoundaryData(solverState.isTraversalInverted());

  logTraceOutWith1Argument( "endIteration(State)", solverState);
}
void peano::applications::poisson::multigrid::mappings::SpacetreeGrid2PlotSolution::createCell(
  peano::applications::poisson::multigrid::SpacetreeGridCell&          fineGridCell,
  peano::applications::poisson::multigrid::SpacetreeGridVertex *       fineGridVertices,
  const peano::kernel::gridinterface::VertexEnumerator&                fineGridVerticesEnumerator,
  peano::applications::poisson::multigrid::SpacetreeGridVertex const * const  coarseGridVertices,
  const peano::kernel::gridinterface::VertexEnumerator&                coarseGridVerticesEnumerator,
  const peano::applications::poisson::multigrid::SpacetreeGridCell&    coarseGridCell,
  const tarch::la::Vector<DIMENSIONS,int>&                             fineGridPositionOfCell
) {
  logTraceInWith4Arguments( "createCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );
  logTraceOutWith1Argument( "createCell(...)", fineGridCell );
}
void peano::applications::navierstokes::prototype1::mappings::SpacetreeGrid2CalculatePPERHS::createCell(
      peano::applications::navierstokes::prototype1::SpacetreeGridFluidCellEnhancedDivFreeEulerExplicit&                 fineGridCell,
      peano::applications::navierstokes::prototype1::SpacetreeGridFluidVertexEnhancedDivFreeEulerExplicit *              fineGridVertices,
      const peano::kernel::gridinterface::VertexEnumerator&                fineGridVerticesEnumerator,
      peano::applications::navierstokes::prototype1::SpacetreeGridFluidVertexEnhancedDivFreeEulerExplicit const * const  coarseGridVertices,
      const peano::kernel::gridinterface::VertexEnumerator&                coarseGridVerticesEnumerator,
      const peano::applications::navierstokes::prototype1::SpacetreeGridFluidCellEnhancedDivFreeEulerExplicit&           coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                             fineGridPositionOfCell
) {
  logTraceInWith4Arguments( "createCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );
  // @todo Insert your code here
  logTraceOutWith1Argument( "createCell(...)", fineGridCell );
}
Пример #26
0
void peano::applications::navierstokes::prototype1::mappings::SpacetreeGrid2MergeA::destroyVertex(
      const peano::applications::navierstokes::prototype1::SpacetreeGridFluidVertexEnhancedDivFreeEulerExplicit&   fineGridVertex,
      const tarch::la::Vector<DIMENSIONS,double>&                    fineGridX,
      const tarch::la::Vector<DIMENSIONS,double>&                    fineGridH,
      peano::applications::navierstokes::prototype1::SpacetreeGridFluidVertexEnhancedDivFreeEulerExplicit const * const  coarseGridVertices,
      const peano::kernel::gridinterface::VertexEnumerator&          coarseGridVerticesEnumerator,
      const peano::applications::navierstokes::prototype1::SpacetreeGridFluidCellEnhancedDivFreeEulerExplicit&           coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfVertex
) {
  logTraceInWith6Arguments( "destroyVertex(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );
  // @todo Insert your code here
  logTraceOutWith1Argument( "destroyVertex(...)", fineGridVertex );
}
Пример #27
0
void peanoclaw::mappings::Cleanup::leaveCell(
    peanoclaw::Cell&           fineGridCell,
    peanoclaw::Vertex * const  fineGridVertices,
    const peano::grid::VertexEnumerator&          fineGridVerticesEnumerator,
    peanoclaw::Vertex * const  coarseGridVertices,
    const peano::grid::VertexEnumerator&          coarseGridVerticesEnumerator,
    peanoclaw::Cell&           coarseGridCell,
    const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfCell
) {
    logTraceInWith4Arguments( "leaveCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );
    // @todo Insert your code here
    logTraceOutWith1Argument( "leaveCell(...)", fineGridCell );
}
void peano::applications::faxen::mappings::SpacetreeGrid2ComputeVelocitiesDerivatives::createCell(
      peano::applications::faxen::SpacetreeGridCell&                 fineGridCell,
      peano::applications::faxen::SpacetreeGridVertex *              fineGridVertices,
      const peano::kernel::gridinterface::VertexEnumerator&                fineGridVerticesEnumerator,
      peano::applications::faxen::SpacetreeGridVertex const * const  coarseGridVertices,
      const peano::kernel::gridinterface::VertexEnumerator&                coarseGridVerticesEnumerator,
      const peano::applications::faxen::SpacetreeGridCell&           coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                             fineGridPositionOfCell
) {
  logTraceInWith4Arguments( "createCell(...)", fineGridCell, fineGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfCell );
  // @todo Insert your code here
  logTraceOutWith1Argument( "createCell(...)", fineGridCell );
}
void peano::applications::faxen::mappings::SpacetreeGrid2ComputeVelocitiesDerivatives::destroyVertex(
      const peano::applications::faxen::SpacetreeGridVertex&   fineGridVertex,
      const tarch::la::Vector<DIMENSIONS,double>&                    fineGridX,
      const tarch::la::Vector<DIMENSIONS,double>&                    fineGridH,
      peano::applications::faxen::SpacetreeGridVertex const * const  coarseGridVertices,
      const peano::kernel::gridinterface::VertexEnumerator&          coarseGridVerticesEnumerator,
      const peano::applications::faxen::SpacetreeGridCell&           coarseGridCell,
      const tarch::la::Vector<DIMENSIONS,int>&                       fineGridPositionOfVertex
) {
  logTraceInWith6Arguments( "destroyVertex(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );
  // @todo Insert your code here
  logTraceOutWith1Argument( "destroyVertex(...)", fineGridVertex );
}
Пример #30
0
void peanoclaw::mappings::Cleanup::createHangingVertex(
    peanoclaw::Vertex&     fineGridVertex,
    const tarch::la::Vector<DIMENSIONS,double>&                fineGridX,
    const tarch::la::Vector<DIMENSIONS,double>&                fineGridH,
    peanoclaw::Vertex * const   coarseGridVertices,
    const peano::grid::VertexEnumerator&      coarseGridVerticesEnumerator,
    peanoclaw::Cell&       coarseGridCell,
    const tarch::la::Vector<DIMENSIONS,int>&                   fineGridPositionOfVertex
) {
    logTraceInWith6Arguments( "createHangingVertex(...)", fineGridVertex, fineGridX, fineGridH, coarseGridVerticesEnumerator.toString(), coarseGridCell, fineGridPositionOfVertex );
    // @todo Insert your code here
    logTraceOutWith1Argument( "createHangingVertex(...)", fineGridVertex );
}