Commit d451bb2a authored by Markus Holzer's avatar Markus Holzer
Browse files

Fix almost everything

parent b476c0cb
Pipeline #38690 failed with stages
in 17 minutes and 57 seconds
......@@ -38,7 +38,7 @@
using namespace walberla;
typedef GhostLayerField<double> ScalarField;
typedef GhostLayerField<double, 1> ScalarField;
void testJacobi2D()
......@@ -54,7 +54,7 @@ void testJacobi2D()
true, true, true ); // full periodicity
BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", 1, real_t(0.0));
BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0));
// Initialize a quarter of the field with ones, the rest remains 0
// Jacobi averages the domain -> every cell should be at 0.25 at sufficiently many timesteps
......
......@@ -37,7 +37,7 @@
using namespace walberla;
typedef GhostLayerField<real_t> ScalarField_T;
typedef GhostLayerField<real_t, 1> ScalarField_T;
// U with Dirichlet Boundary
void initU( const shared_ptr< StructuredBlockStorage > & blocks, const BlockDataID & srcId )
......@@ -92,10 +92,10 @@ void testPoisson()
false, false, false ); // no periodicity
BlockDataID fieldID = field::addToStorage<ScalarField_T>(blocks, "Field", 1, real_t(0.0));
BlockDataID fieldID = field::addToStorage<ScalarField_T>(blocks, "Field", real_t(0.0));
initU( blocks, fieldID );
BlockDataID fId = field::addToStorage< ScalarField_T >( blocks, "f", 1, real_t(0.0));
BlockDataID fId = field::addToStorage< ScalarField_T >( blocks, "f", real_t(0.0));
initF( blocks, fId );
typedef blockforest::communication::UniformBufferedScheme<stencil::D2Q9> CommScheme;
......
......@@ -32,7 +32,7 @@
using namespace walberla;
typedef GhostLayerField<double> ScalarField;
typedef GhostLayerField<double, 1> ScalarField;
void testMultipleFieldSwaps()
{
uint_t xSize = 5;
......@@ -46,9 +46,9 @@ void testMultipleFieldSwaps()
true, true, true ); // full periodicity
BlockDataID fieldID_1 = field::addToStorage<ScalarField>(blocks, "Field_1", 1, real_t(1.0));
BlockDataID fieldID_2 = field::addToStorage<ScalarField>(blocks, "Field_2", 1, real_t(1.0));
BlockDataID fieldID_3 = field::addToStorage<ScalarField>(blocks, "Field_3", 1, real_t(1.0));
BlockDataID fieldID_1 = field::addToStorage<ScalarField>(blocks, "Field_1", real_t(1.0));
BlockDataID fieldID_2 = field::addToStorage<ScalarField>(blocks, "Field_2", real_t(1.0));
BlockDataID fieldID_3 = field::addToStorage<ScalarField>(blocks, "Field_3", real_t(1.0));
pystencils::MultipleFieldSwaps kernel(fieldID_1, fieldID_2, fieldID_3);
......
......@@ -45,7 +45,6 @@ typedef LatticeModel_T::CommunicationStencil CommunicationStencil_T;
typedef lbm::PdfField< LatticeModel_T > PdfField_T;
typedef GhostLayerField< real_t, LatticeModel_T::Stencil::D > VectorField_T;
typedef GhostLayerField< real_t, 1 > ScalarField_T;
typedef walberla::uint8_t flag_t;
typedef FlagField< flag_t > FlagField_T;
......
......@@ -32,13 +32,13 @@
using namespace walberla;
using ScalarField = GhostLayerField<int, 1>;
using ScalarField = GhostLayerField<int>;
int main( int argc, char ** argv )
{
auto pythonManager = python_coupling::Manager::instance();
pythonManager->addExporterFunction( field::exportModuleToPython<Field<int, 1>> );
pythonManager->addExporterFunction( field::exportModuleToPython<Field<int>> );
pythonManager->triggerInitialization();
if ( argc != 2 )
......@@ -73,7 +73,7 @@ int main( int argc, char ** argv )
WALBERLA_CHECK_EQUAL( result, 15 )
ScalarField f ( 3,2,2, 1, 25 );
ScalarField f ( 3,2,2, 1, 1, 25 );
python_coupling::PythonCallback cb2 ( pythonFile, "cb2" );
WALBERLA_ASSERT( cb2.isCallable() )
......
......@@ -53,24 +53,24 @@ int main( int argc, char ** argv )
auto pythonManager = python_coupling::Manager::instance();
pythonManager->addExporterFunction( field::exportModuleToPython<Field<int, 3>, Field<real_t, 3>> );
pythonManager->addBlockDataConversion< Field<int, 3>, Field<real_t, 3> >() ;
pythonManager->addExporterFunction( field::exportModuleToPython<Field<int>, Field<real_t>> );
pythonManager->addBlockDataConversion< Field<int>, Field<real_t> >() ;
pythonManager->addExporterFunction( blockforest::exportModuleToPython<stencil::D2Q9> );
pythonManager->triggerInitialization();
shared_ptr< StructuredBlockForest > blocks = blockforest::createUniformBlockGrid( 1,1,1, 20,20,1, real_t(1.0), false, true,true,true );
auto srcIntFieldID = field::addToStorage< GhostLayerField<int, 3> >( blocks, "srcIntFieldID", int(0), field::fzyx, 1 );
auto dstIntFieldID = field::addToStorage< GhostLayerField<int, 3> >( blocks, "dstIntFieldID", int(0), field::fzyx, 1 );
auto srcIntFieldID = field::addToStorage< GhostLayerField<int> >( blocks, "srcIntFieldID", 3, int(0), field::fzyx, 1 );
auto dstIntFieldID = field::addToStorage< GhostLayerField<int> >( blocks, "dstIntFieldID", 3, int(0), field::fzyx, 1 );
auto srcDoubleFieldID = field::addToStorage< GhostLayerField<real_t, 3> >( blocks, "srcDoubleFieldID", real_t(0.0), field::fzyx, 1 );
auto dstDoubleFieldID = field::addToStorage< GhostLayerField<real_t, 3> >( blocks, "dstDoubleFieldID", real_t(0.0), field::fzyx, 1 );
auto srcDoubleFieldID = field::addToStorage< GhostLayerField<real_t> >( blocks, "srcDoubleFieldID", 3, real_t(0.0), field::fzyx, 1 );
auto dstDoubleFieldID = field::addToStorage< GhostLayerField<real_t> >( blocks, "dstDoubleFieldID", 3, real_t(0.0), field::fzyx, 1 );
// random init
for( auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt )
{
auto srcIntField = blockIt->getData<GhostLayerField<int, 3> >( srcIntFieldID );
auto srcDoubleField = blockIt->getData<GhostLayerField<real_t, 3> >( srcDoubleFieldID );
auto srcIntField = blockIt->getData<GhostLayerField<int> >( srcIntFieldID );
auto srcDoubleField = blockIt->getData<GhostLayerField<real_t> >( srcDoubleFieldID );
for( auto cellIt = srcIntField->begin(); cellIt != srcIntField->end(); ++cellIt )
*cellIt = math::intRandom( int(0), int(42) );
for( auto cellIt = srcDoubleField->begin(); cellIt != srcDoubleField->end(); ++cellIt )
......@@ -85,10 +85,10 @@ int main( int argc, char ** argv )
// check for equivalence
for( auto blockIt = blocks->begin(); blockIt != blocks->end(); ++blockIt )
{
auto srcIntField = blockIt->getData<GhostLayerField<int, 3> >( srcIntFieldID );
auto dstIntField = blockIt->getData<GhostLayerField<int, 3> >( dstIntFieldID );
auto srcDoubleField = blockIt->getData<GhostLayerField<real_t, 3> >( srcDoubleFieldID );
auto dstDoubleField = blockIt->getData<GhostLayerField<real_t, 3> >( dstDoubleFieldID );
auto srcIntField = blockIt->getData<GhostLayerField<int> >( srcIntFieldID );
auto dstIntField = blockIt->getData<GhostLayerField<int> >( dstIntFieldID );
auto srcDoubleField = blockIt->getData<GhostLayerField<real_t> >( srcDoubleFieldID );
auto dstDoubleField = blockIt->getData<GhostLayerField<real_t> >( dstDoubleFieldID );
{
for(cell_idx_t z = 0; z < cell_idx_c(srcIntField->zSize()); ++z)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment