43 #include <lifev/one_d_fsi/fem/OneDFSIBCHandler.hpp> 57 #ifdef HAVE_LIFEV_DEBUG 58 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::OneDFSIModel_BCHandler] Creating OneDFSIModel_BC classes.\n";
61 M_boundary[ OneDFSI::left ].reset (
new bc_Type ( OneDFSI::left ) );
62 M_boundary[ OneDFSI::right ].reset (
new bc_Type ( OneDFSI::right ) );
64 M_boundarySet[ OneDFSI::left ].insert ( std::make_pair ( OneDFSI::first,
false ) );
65 M_boundarySet[ OneDFSI::left ].insert ( std::make_pair ( OneDFSI::second,
false ) );
66 M_boundarySet[ OneDFSI::right ].insert ( std::make_pair ( OneDFSI::first,
false ) );
67 M_boundarySet[ OneDFSI::right ].insert ( std::make_pair ( OneDFSI::second,
false ) );
75 M_boundary[ OneDFSI::left ].reset (
new bc_Type ( *bcHandler.M_boundary.find ( OneDFSI::left )->second ) );
76 M_boundary[ OneDFSI::right ].reset (
new bc_Type ( *bcHandler.M_boundary.find ( OneDFSI::right )->second ) );
78 for ( std::vector < bcFunctionSolverDefinedPtr_Type >::const_iterator i = bcHandler.M_defaultFunctions.begin();
79 i != bcHandler.M_defaultFunctions.end() ; ++i )
81 bcFunctionSolverDefinedPtr_Type BCDefaultFunction (
new bcFunctionSolverDefined_Type ( *i->get() ) );
82 M_defaultFunctions.push_back ( BCDefaultFunction );
89 std::cerr <<
"!!! WARNING: COPY CONSTRUCTOR DOES NOT CREATE A TRUE COPY !!!" << std::endl;
90 std::exit ( EXIT_FAILURE );
98 const fluxPtr_Type& fluxPtr, vectorPtrContainer_Type& rhs )
100 M_boundary[ OneDFSI::left ]->applyBC ( time, timeStep, solution, fluxPtr, rhs );
101 M_boundary[ OneDFSI::right ]->applyBC ( time, timeStep, solution, fluxPtr, rhs );
107 M_boundary[ OneDFSI::left ]->applyViscoelasticBC ( fluxPtr, matrix, rhs );
108 M_boundary[ OneDFSI::right ]->applyViscoelasticBC ( fluxPtr, matrix, rhs );
116 const bcType_Type& bcType,
const bcFunction_Type& bcFunction )
118 M_boundarySet[bcSide][bcLine] =
true;
119 M_boundary[bcSide]->setType ( bcLine, bcType );
120 M_boundary[bcSide]->setBCFunction ( bcLine, bcFunction );
122 #ifdef HAVE_LIFEV_DEBUG 123 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::setBC] imposing function at " 124 << bcSide <<
" boundary (" << bcLine <<
" bcLine), variable " << bcType <<
".\n";
131 #ifdef HAVE_LIFEV_DEBUG 132 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::OneDFSIModel_BCHandler] Set Default BC ... \n";
135 if ( !M_boundarySet[ OneDFSI::left ][OneDFSI::first] )
138 bcFunctionSolverDefinedPtr_Type bcDefaultFunction (
new OneDFSIFunctionSolverDefinedRiemann ( OneDFSI::left, OneDFSI::W1 ) );
139 M_defaultFunctions.push_back ( bcDefaultFunction );
142 bcFunction_Type bcFunction;
143 bcFunction.setFunction ( std::bind ( &OneDFSIFunctionSolverDefinedRiemann::operator(),
144 dynamic_cast<OneDFSIFunctionSolverDefinedRiemann*> ( & ( *M_defaultFunctions.back() ) ), std::placeholders::_1, std::placeholders::_2 ) );
146 #ifdef HAVE_LIFEV_DEBUG 147 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::setDefaultBC] left-first-W1 Invoking setBC.\n";
152 if ( !M_boundarySet[ OneDFSI::left ][OneDFSI::second] )
155 bcFunctionSolverDefinedPtr_Type bcDefaultFunction (
new OneDFSIFunctionSolverDefinedCompatibility ( OneDFSI::left, OneDFSI::W2 ) );
156 M_defaultFunctions.push_back ( bcDefaultFunction );
159 bcFunction_Type bcFunction;
160 bcFunction.setFunction ( std::bind ( &OneDFSIFunctionSolverDefinedCompatibility::operator(),
161 dynamic_cast<OneDFSIFunctionSolverDefinedCompatibility*> ( & ( *M_defaultFunctions.back() ) ), std::placeholders::_1, std::placeholders::_2 ) );
163 #ifdef HAVE_LIFEV_DEBUG 164 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::setDefaultBC] left-second-W2 Invoking setBC.\n";
169 if ( !M_boundarySet[ OneDFSI::right ][ OneDFSI::first ] )
172 bcFunctionSolverDefinedPtr_Type bcDefaultFunction (
new OneDFSIFunctionSolverDefinedRiemann ( OneDFSI::right, OneDFSI::W2 ) );
173 M_defaultFunctions.push_back ( bcDefaultFunction );
176 bcFunction_Type bcFunction;
177 bcFunction.setFunction ( std::bind ( &OneDFSIFunctionSolverDefinedRiemann::operator(),
178 dynamic_cast<OneDFSIFunctionSolverDefinedRiemann*> ( & ( *M_defaultFunctions.back() ) ), std::placeholders::_1, std::placeholders::_2 ) );
180 #ifdef HAVE_LIFEV_DEBUG 181 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::setDefaultBC] right-first-W2 Invoking setBC.\n";
186 if ( !M_boundarySet[ OneDFSI::right ][ OneDFSI::second ] )
189 bcFunctionSolverDefinedPtr_Type bcDefaultFunction (
new OneDFSIFunctionSolverDefinedCompatibility ( OneDFSI::right, OneDFSI::W1 ) );
190 M_defaultFunctions.push_back ( bcDefaultFunction );
193 bcFunction_Type bcFunction;
194 bcFunction.setFunction ( std::bind ( &OneDFSIFunctionSolverDefinedCompatibility::operator(),
195 dynamic_cast<OneDFSIFunctionSolverDefinedCompatibility*> ( & ( *M_defaultFunctions.back() ) ), std::placeholders::_1, std::placeholders::_2 ) );
197 #ifdef HAVE_LIFEV_DEBUG 198 debugStream ( 6311 ) <<
"[OneDFSIModel_BCHandler::setDefaultBC] right-second-W1 Invoking setBC.\n";
207 for ( std::vector < bcFunctionSolverDefinedPtr_Type >::const_iterator i = M_defaultFunctions.begin() ; i < M_defaultFunctions.end() ; ++i )
209 ( *i )->setFluxSource ( fluxPtr, sourcePtr );
216 for ( std::vector < bcFunctionSolverDefinedPtr_Type >::const_iterator i = M_defaultFunctions.begin() ; i < M_defaultFunctions.end() ; ++i )
218 ( *i )->setSolution ( solution );
OneDFSIBCHandler(const OneDFSIBCHandler &bcHandler)
Copy constructor.
void setBC(const bcSide_Type &bcSide, const bcLine_Type &bcLine, const bcType_Type &bcType, const bcFunction_Type &bcFunction)
Set a boundary condition.
void updateInverseJacobian(const UInt &iQuadPt)
void setFluxSource(const fluxPtr_Type &fluxPtr, const sourcePtr_Type &sourcePtr)
Set the flux and the source classes for the problem.
void applyBC(const Real &time, const Real &timeStep, const solution_Type &solution, const fluxPtr_Type &fluxPtr, vectorPtrContainer_Type &rhs)
Apply boundary conditions to the rhs of the Taylor-Galerkin problem.
OneDFSIBCHandler - Class featuring methods to handle boundary conditions.
double Real
Generic real data.
OneDFSIBCHandler()
Empty Constructor.
void setSolution(const solutionPtr_Type &solutionPtr)
Set the solution of the problem.
void setDefaultBC()
Set the default boundary conditions.
void applyViscoelasticBC(const fluxPtr_Type &fluxPtr, matrix_Type &matrix, vector_Type &rhs)
Apply boundary conditions to the rhs of the viscoelastic problem.