Skip to content

Reply To: stl units and format

#9638
talco
Participant

Below is a section of my prepareGeometry where I’m getting my error
I have printed the xtend and origin that are used for IndicatorCuboid3D

============Terminal messages=====================
[prepareGeometry] Prepare Geometry …
[SuperGeometry3D] cleaned 0 outer boundary voxel(s)
[prepareGeometry] origin =
[prepareGeometry] [-0.01 0.005 0.005]
[prepareGeometry] Pextend =
[prepareGeometry] [0.02 -0.01 -0.01]
cylinder3d: ../../../src/functors/analytical/indicator/indicatorF3D.hh:643: olb::IndicatorCuboid3D<T>::IndicatorCuboid3D(olb::Vector<T, 3>, olb::Vector<T, 3>) [with S = double]: Assertion `_xLength>0 && _yLength>0 && _zLength>0′ failed.
Aborted (core dumped)
==============================================

============part of the code=====================

void prepareGeometry( UnitConverter<T,DESCRIPTOR> const& converter, IndicatorF3D<T>& indicator,
STLreader<T>& stlReader, SuperGeometry<T,3>& superGeometry )
{

OstreamManager clout( std::cout,"prepareGeometry" );
clout << "Prepare Geometry ..." << std::endl;

superGeometry.rename( 0,2,indicator );
superGeometry.rename( 2,1,stlReader );
superGeometry.clean();

Vector<T,3> origin = superGeometry.getStatistics().getMinPhysR( 2 );
origin[1] += converter.getConversionFactorLength()/2.;
origin[2] += converter.getConversionFactorLength()/2.;

Vector<T,3> extend = superGeometry.getStatistics().getMaxPhysR( 2 );
extend[1] = extend[1]-origin[1]-converter.getConversionFactorLength()/2.;
extend[2] = extend[2]-origin[2]-converter.getConversionFactorLength()/2.;

// Set material number for inflow
origin[0] = superGeometry.getStatistics().getMinPhysR( 2 )[0]-converter.getConversionFactorLength();
extend[0] = 2*converter.getConversionFactorLength();

clout << "origin = " << std::endl;
clout << origin << std::endl;
clout << "Pextend = " << std::endl;
clout << extend << std::endl;

IndicatorCuboid3D<T> inflow( extend,origin );
superGeometry.rename( 2,3,inflow );