diff --git a/src/RBFMeshMotionSolver/RBFCoarsening.C b/src/RBFMeshMotionSolver/RBFCoarsening.C index c6702e9b..a1665e95 100644 --- a/src/RBFMeshMotionSolver/RBFCoarsening.C +++ b/src/RBFMeshMotionSolver/RBFCoarsening.C @@ -11,6 +11,35 @@ namespace rbf { Foam::debug::debugSwitch RBFCoarsening::debug( "RBFInterpolation", 0 ); + RBFCoarsening::RBFCoarsening() + : + rbf( std::shared_ptr ( new RBFInterpolation() ) ), + rbfCoarse( std::shared_ptr ( new RBFInterpolation( rbf->rbfFunction, rbf->polynomialTerm, rbf->cpu ) ) ), + enabled( false ), + livePointSelection( false ), + livePointSelectionSumValues( false ), + tol( 0 ), + tolLivePointSelection( 0 ), + coarseningMinPoints( 0 ), + coarseningMaxPoints( 0 ), + twoPointSelection( false ), + surfaceCorrection( false ), + ratioRadiusError( 10 ), + exportTxt( false ), + selectedPositions(), + nbStaticFaceCentersRemove( 0 ), + positions(), + positionsInterpolation(), + values(), + errorInterpolationCoarse(), + closestBoundaryIndexCorrection(), + valuesCorrection(), + nbMovingFaceCenters( 0 ), + fileExportIndex( 0 ) + { + assert( rbf ); + } + RBFCoarsening::RBFCoarsening( std::shared_ptr rbf ) : rbf( rbf ), diff --git a/src/RBFMeshMotionSolver/RBFCoarsening.H b/src/RBFMeshMotionSolver/RBFCoarsening.H index 8275ced0..49af4521 100644 --- a/src/RBFMeshMotionSolver/RBFCoarsening.H +++ b/src/RBFMeshMotionSolver/RBFCoarsening.H @@ -16,6 +16,8 @@ namespace rbf class RBFCoarsening { public: + RBFCoarsening(); + explicit RBFCoarsening( std::shared_ptr rbf ); RBFCoarsening( diff --git a/src/RBFMeshMotionSolver/RBFInterpolation.C b/src/RBFMeshMotionSolver/RBFInterpolation.C index 919c289e..a924950b 100644 --- a/src/RBFMeshMotionSolver/RBFInterpolation.C +++ b/src/RBFMeshMotionSolver/RBFInterpolation.C @@ -5,9 +5,26 @@ */ #include "RBFInterpolation.H" +#include "TPSFunction.H" namespace rbf { + RBFInterpolation::RBFInterpolation() + : + rbfFunction( std::shared_ptr ( new TPSFunction() ) ), + polynomialTerm( true ), + cpu( false ), + computed( false ), + n_A( 0 ), + n_B( 0 ), + dimGrid( 0 ), + Hhat(), + Phi(), + lu(), + positions(), + positionsInterpolation() + {} + RBFInterpolation::RBFInterpolation( std::shared_ptr rbfFunction ) : rbfFunction( rbfFunction ), diff --git a/src/RBFMeshMotionSolver/RBFInterpolation.H b/src/RBFMeshMotionSolver/RBFInterpolation.H index e083c5d6..9f580d58 100644 --- a/src/RBFMeshMotionSolver/RBFInterpolation.H +++ b/src/RBFMeshMotionSolver/RBFInterpolation.H @@ -20,6 +20,8 @@ namespace rbf class RBFInterpolation { public: + RBFInterpolation(); + explicit RBFInterpolation( std::shared_ptr rbfFunction ); RBFInterpolation( diff --git a/src/fsi/MultiLevelSolver.C b/src/fsi/MultiLevelSolver.C index de21cdfc..32ad1c5f 100644 --- a/src/fsi/MultiLevelSolver.C +++ b/src/fsi/MultiLevelSolver.C @@ -8,6 +8,41 @@ namespace fsi { + MultiLevelSolver::MultiLevelSolver( + shared_ptr solver, + shared_ptr couplingGridSolver, + int participantId, + int level + ) + : + solver( solver ), + couplingGridSolver( couplingGridSolver ), + rbfInterpToCouplingMesh( shared_ptr ( new RBFCoarsening() ) ), + rbfInterpToMesh( shared_ptr ( new RBFCoarsening() ) ), + participantId( participantId ), + level( level ), + couplingGridSize( 0 ) + { + assert( solver ); + assert( couplingGridSolver ); + assert( participantId == 0 || participantId == 1 ); + assert( level >= 0 ); + assert( rbfInterpToCouplingMesh ); + assert( rbfInterpToMesh ); + + matrix couplingGridPositions; + + if ( participantId == 0 ) + couplingGridSolver->getWritePositions( couplingGridPositions ); + + if ( participantId == 1 ) + couplingGridSolver->getReadPositions( couplingGridPositions ); + + couplingGridSize = couplingGridPositions.rows(); + + assert( couplingGridSize > 0 ); + } + MultiLevelSolver::MultiLevelSolver( shared_ptr solver, shared_ptr couplingGridSolver, diff --git a/src/fsi/MultiLevelSolver.H b/src/fsi/MultiLevelSolver.H index e209db8c..6ffea890 100644 --- a/src/fsi/MultiLevelSolver.H +++ b/src/fsi/MultiLevelSolver.H @@ -23,6 +23,13 @@ namespace fsi class MultiLevelSolver { public: + MultiLevelSolver( + shared_ptr solver, + shared_ptr couplingGridSolver, + int participantId, + int level + ); + MultiLevelSolver( shared_ptr solver, shared_ptr couplingGridSolver, diff --git a/src/tests/testsuite-sdc-fsi/test_sdcexplicitsolidsolver.C b/src/tests/testsuite-sdc-fsi/test_sdcexplicitsolidsolver.C index 15a9e037..ff6a4f46 100644 --- a/src/tests/testsuite-sdc-fsi/test_sdcexplicitsolidsolver.C +++ b/src/tests/testsuite-sdc-fsi/test_sdcexplicitsolidsolver.C @@ -58,36 +58,10 @@ class SDCFsiExplicitSolidSolverTest : public ::testing::Test int minIter = 5; std::shared_ptr fluid( new tubeflow::SDCTubeFlowFluidSolver( a0, u0, p0, dt, cmk, N, L, T, rho_f ) ); + std::shared_ptr solid( new tubeflow::SDCTubeFlowExplicitLinearSolidSolver( N, nu, rho_s, h, L, dt, G, E0, r0, p0, T ) ); - std::shared_ptr solid; - solid = std::shared_ptr( new tubeflow::SDCTubeFlowExplicitLinearSolidSolver( N, nu, rho_s, h, L, dt, G, E0, r0, p0, T ) ); - - assert( solid ); - - shared_ptr rbfFunction; - shared_ptr rbfInterpolator; - shared_ptr rbfInterpToCouplingMesh; - shared_ptr rbfInterpToMesh; - - rbfFunction = shared_ptr( new TPSFunction() ); - rbfInterpolator = shared_ptr( new RBFInterpolation( rbfFunction ) ); - rbfInterpToCouplingMesh = shared_ptr ( new RBFCoarsening( rbfInterpolator ) ); - - rbfFunction = shared_ptr( new TPSFunction() ); - rbfInterpolator = shared_ptr( new RBFInterpolation( rbfFunction ) ); - rbfInterpToMesh = shared_ptr ( new RBFCoarsening( rbfInterpolator ) ); - - shared_ptr fluidSolver( new MultiLevelSolver( fluid, fluid, rbfInterpToCouplingMesh, rbfInterpToMesh, 0, 0 ) ); - - rbfFunction = shared_ptr( new TPSFunction() ); - rbfInterpolator = shared_ptr( new RBFInterpolation( rbfFunction ) ); - rbfInterpToCouplingMesh = shared_ptr ( new RBFCoarsening( rbfInterpolator ) ); - - rbfFunction = shared_ptr( new TPSFunction() ); - rbfInterpolator = shared_ptr( new RBFInterpolation( rbfFunction ) ); - rbfInterpToMesh = shared_ptr ( new RBFCoarsening( rbfInterpolator ) ); - - shared_ptr solidSolver( new MultiLevelSolver( solid, fluid, rbfInterpToCouplingMesh, rbfInterpToMesh, 1, 0 ) ); + shared_ptr fluidSolver( new MultiLevelSolver( fluid, fluid, 0, 0 ) ); + shared_ptr solidSolver( new MultiLevelSolver( solid, fluid, 1, 0 ) ); std::shared_ptr< std::list > > convergenceMeasures; convergenceMeasures = std::shared_ptr > >( new std::list > );