Commit 5cf8fc86 authored by Cristiano Malossi's avatar Cristiano Malossi
Browse files

First part of the "modularization" of the Multiscale.

Introducing IFDEF
parent d28ddff1
......@@ -113,36 +113,40 @@ MultiscaleCouplingBoundaryCondition::setupCoupling()
if ( myModel ( i ) )
switch ( M_models[i]->type() )
{
case Fluid3D:
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
case Windkessel0D:
applyBoundaryConditions3D< MultiscaleModelFluid3D > ( i );
applyBoundaryConditions0D< MultiscaleModelWindkessel0D > ( i );
break;
case FSI3D:
case ZeroDimensional:
applyBoundaryConditions3D< MultiscaleModelFSI3D > ( i );
applyBoundaryConditions0D< MultiscaleModel0D > ( i );
break;
#endif
#if defined(LIFEV_HAS_ONEDFSI)
case FSI1D:
applyBoundaryConditions1D< MultiscaleModelFSI1D > ( i );
break;
#endif
#if defined(LIFEV_HAS_NAVIERSTOKES)
case Fluid3D:
case Windkessel0D:
applyBoundaryConditions0D< MultiscaleModelWindkessel0D > ( i );
applyBoundaryConditions3D< MultiscaleModelFluid3D > ( i );
break;
#endif
#if defined(LIFEV_HAS_FSI)
case FSI3D:
case ZeroDimensional:
applyBoundaryConditions0D< MultiscaleModel0D > ( i );
applyBoundaryConditions3D< MultiscaleModelFSI3D > ( i );
break;
#endif
default:
switchErrorMessage ( M_models[i] );
......
......@@ -37,16 +37,36 @@
#ifndef MultiscaleCouplingBoundaryCondition_H
#define MultiscaleCouplingBoundaryCondition_H 1
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
#include <lifev/bc_interface/0D/bc/BCInterface0D.hpp>
#endif
#if defined(LIFEV_HAS_ONEDFSI)
#include <lifev/bc_interface/1D/bc/BCInterface1D.hpp>
#endif
#if defined(LIFEV_HAS_FSI) || defined(LIFEV_HAS_NAVIERSTOKES)
#include <lifev/bc_interface/3D/bc/BCInterface3D.hpp>
#endif
#include <lifev/multiscale/solver/MultiscaleCoupling.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
#include <lifev/multiscale/solver/MultiscaleModelWindkessel0D.hpp>
#include <lifev/multiscale/solver/MultiscaleModel0D.hpp>
#endif
#if defined(LIFEV_HAS_ONEDFSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#endif
#if defined(LIFEV_HAS_NAVIERSTOKES)
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#endif
#if defined(LIFEV_HAS_FSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#endif
namespace LifeV
{
......@@ -142,18 +162,23 @@ private:
//! @name Private Methods
//@{
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
//! Apply the boundary condition to the specific 0D model
template< class ModelType >
void applyBoundaryConditions0D ( const UInt& i );
#endif
#if defined(LIFEV_HAS_ONEDFSI)
//! Apply the boundary condition to the specific 1D model
template< class ModelType >
void applyBoundaryConditions1D ( const UInt& i );
#endif
#if defined(LIFEV_HAS_FSI) || defined(LIFEV_HAS_NAVIERSTOKES)
//! Apply the boundary condition to the specific 3D model
template< class ModelType >
void applyBoundaryConditions3D ( const UInt& i );
#endif
//@}
......@@ -181,6 +206,7 @@ inline multiscaleCoupling_Type* createMultiscaleCouplingBoundaryCondition()
// ===================================================
// Template implementation
// ===================================================
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
template< class ModelType >
inline void
MultiscaleCouplingBoundaryCondition::applyBoundaryConditions0D ( const UInt& i )
......@@ -197,7 +223,9 @@ MultiscaleCouplingBoundaryCondition::applyBoundaryConditions0D ( const UInt& i )
model->bcInterface().insertBC();
}
}
#endif
#if defined(LIFEV_HAS_ONEDFSI)
template< class ModelType >
inline void
MultiscaleCouplingBoundaryCondition::applyBoundaryConditions1D ( const UInt& i )
......@@ -214,7 +242,9 @@ MultiscaleCouplingBoundaryCondition::applyBoundaryConditions1D ( const UInt& i )
model->bcInterface().insertBC();
}
}
#endif
#if defined(LIFEV_HAS_FSI) || defined(LIFEV_HAS_NAVIERSTOKES)
template< class ModelType >
inline void
MultiscaleCouplingBoundaryCondition::applyBoundaryConditions3D ( const UInt& i )
......@@ -232,6 +262,7 @@ MultiscaleCouplingBoundaryCondition::applyBoundaryConditions3D ( const UInt& i )
model->bcInterface().insertBC();
}
}
#endif
} // Namespace Multiscale
} // Namespace LifeV
......
......@@ -38,11 +38,23 @@
#define MultiscaleCouplingMeanNormalStress_H 1
#include <lifev/multiscale/solver/MultiscaleCoupling.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
#include <lifev/multiscale/solver/MultiscaleModelWindkessel0D.hpp>
#include <lifev/multiscale/solver/MultiscaleModel0D.hpp>
#endif
#if defined(LIFEV_HAS_ONEDFSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#endif
#if defined(LIFEV_HAS_NAVIERSTOKES)
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#endif
#if defined(LIFEV_HAS_FSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#endif
namespace LifeV
{
......
......@@ -38,11 +38,23 @@
#define MultiscaleCouplingMeanTotalNormalStress_H 1
#include <lifev/multiscale/solver/MultiscaleCoupling.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
#include <lifev/multiscale/solver/MultiscaleModelWindkessel0D.hpp>
#include <lifev/multiscale/solver/MultiscaleModel0D.hpp>
#endif
#if defined(LIFEV_HAS_ONEDFSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#endif
#if defined(LIFEV_HAS_NAVIERSTOKES)
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#endif
#if defined(LIFEV_HAS_FSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#endif
namespace LifeV
{
......
......@@ -197,19 +197,29 @@ typedef boost::shared_ptr< multiscaleData_Type >
inline void
multiscaleMapsDefinition()
{
#if defined(LIFEV_HAS_NAVIERSTOKES)
multiscaleModelsMap["Fluid3D"] = Fluid3D;
#endif
#if defined(LIFEV_HAS_ONEDFSI)
multiscaleModelsMap["FSI1D"] = FSI1D;
#endif
#if defined(LIFEV_HAS_FSI)
multiscaleModelsMap["FSI3D"] = FSI3D;
#endif
multiscaleModelsMap["Multiscale"] = Multiscale;
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
multiscaleModelsMap["Windkessel0D"] = Windkessel0D;
multiscaleModelsMap["ZeroDimensional"] = ZeroDimensional;
#endif
multiscaleCouplingsMap["BoundaryCondition"] = BoundaryCondition;
multiscaleCouplingsMap["MeanNormalStress"] = MeanNormalStress;
multiscaleCouplingsMap["MeanNormalStressArea"] = MeanNormalStressArea;
multiscaleCouplingsMap["MeanNormalStressValve"] = MeanNormalStressValve;
multiscaleCouplingsMap["MeanTotalNormalStress"] = MeanTotalNormalStress;
#if defined(LIFEV_HAS_ONEDFSI) && defined(LIFEV_HAS_FSI)
multiscaleCouplingsMap["MeanNormalStressArea"] = MeanNormalStressArea;
multiscaleCouplingsMap["MeanTotalNormalStressArea"] = MeanTotalNormalStressArea;
#endif
multiscaleAlgorithmsMap["Aitken"] = Aitken;
multiscaleAlgorithmsMap["Broyden"] = Broyden;
......
......@@ -43,10 +43,13 @@
#include <lifev/multiscale/solver/MultiscaleCouplingBoundaryCondition.hpp>
#include <lifev/multiscale/solver/MultiscaleCouplingMeanNormalStress.hpp>
#include <lifev/multiscale/solver/MultiscaleCouplingMeanNormalStressArea.hpp>
#include <lifev/multiscale/solver/MultiscaleCouplingMeanNormalStressValve.hpp>
#include <lifev/multiscale/solver/MultiscaleCouplingMeanTotalNormalStress.hpp>
#if defined(LIFEV_HAS_ONEDFSI) && defined(LIFEV_HAS_FSI)
#include <lifev/multiscale/solver/MultiscaleCouplingMeanNormalStressArea.hpp>
#include <lifev/multiscale/solver/MultiscaleCouplingMeanTotalNormalStressArea.hpp>
#endif
namespace LifeV
{
......@@ -77,10 +80,13 @@ MultiscaleModelMultiscale::MultiscaleModelMultiscale() :
multiscaleCouplingFactory_Type::instance().registerProduct ( BoundaryCondition, &createMultiscaleCouplingBoundaryCondition );
multiscaleCouplingFactory_Type::instance().registerProduct ( MeanNormalStress, &createMultiscaleCouplingMeanNormalStress );
multiscaleCouplingFactory_Type::instance().registerProduct ( MeanNormalStressArea, &createMultiscaleCouplingMeanNormalStressArea );
multiscaleCouplingFactory_Type::instance().registerProduct ( MeanNormalStressValve, &createMultiscaleCouplingMeanNormalStressValve );
multiscaleCouplingFactory_Type::instance().registerProduct ( MeanTotalNormalStress, &createMultiscaleCouplingMeanTotalNormalStress );
#if defined(LIFEV_HAS_ONEDFSI) && defined(LIFEV_HAS_FSI)
multiscaleCouplingFactory_Type::instance().registerProduct ( MeanNormalStressArea, &createMultiscaleCouplingMeanNormalStressArea );
multiscaleCouplingFactory_Type::instance().registerProduct ( MeanTotalNormalStressArea, &createMultiscaleCouplingMeanTotalNormalStressArea );
#endif
}
MultiscaleModelMultiscale::~MultiscaleModelMultiscale()
......
......@@ -44,11 +44,23 @@
#include <lifev/multiscale/solver/MultiscaleCoupling.hpp>
#include <lifev/multiscale/solver/MultiscaleModel.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
#include <lifev/multiscale/solver/MultiscaleModelWindkessel0D.hpp>
#include <lifev/multiscale/solver/MultiscaleModel0D.hpp>
#endif
#if defined(LIFEV_HAS_ONEDFSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI1D.hpp>
#endif
#if defined(LIFEV_HAS_NAVIERSTOKES)
#include <lifev/multiscale/solver/MultiscaleModelFluid3D.hpp>
#endif
#if defined(LIFEV_HAS_FSI)
#include <lifev/multiscale/solver/MultiscaleModelFSI3D.hpp>
#endif
namespace LifeV
{
......
......@@ -65,12 +65,20 @@ MultiscaleSolver::MultiscaleSolver() :
multiscaleMapsDefinition();
//Register the available models
multiscaleModelFactory_Type::instance().registerProduct ( Multiscale, &createMultiscaleModelMultiscale );
#if defined(LIFEV_HAS_NAVIERSTOKES)
multiscaleModelFactory_Type::instance().registerProduct ( Fluid3D, &createMultiscaleModelFluid3D );
#endif
#if defined(LIFEV_HAS_FSI)
multiscaleModelFactory_Type::instance().registerProduct ( FSI3D, &createMultiscaleModelFSI3D );
#endif
#if defined(LIFEV_HAS_ONEDFSI)
multiscaleModelFactory_Type::instance().registerProduct ( FSI1D, &createMultiscaleModelFSI1D );
multiscaleModelFactory_Type::instance().registerProduct ( Multiscale, &createMultiscaleModelMultiscale );
#endif
#if defined(LIFEV_HAS_ZERODIMENSIONAL)
multiscaleModelFactory_Type::instance().registerProduct ( Windkessel0D, &createMultiscaleModelWindkessel0D );
multiscaleModelFactory_Type::instance().registerProduct ( ZeroDimensional, &createMultiscaleModelZeroDimensional );
#endif
}
// ===================================================
......
Supports Markdown
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