37 #include <lifev/bc_interface/3D/function/solid/BCInterfaceFunctionSolverDefinedSolid3D.hpp> 45 BCInterfaceFunctionSolverDefined< BCHandler, StructuralOperator<RegionMesh <LinearTetra> > >::BCInterfaceFunctionSolverDefined() :
52 M_componentsVector (),
53 M_vectorFunctionRobin (),
55 M_robinAlphaCoefficient (),
56 M_robinBetaCoefficient ()
59 #ifdef HAVE_LIFEV_DEBUG 60 debugStream ( 5025 ) <<
"BCInterfaceFunctionSolverDefined::BCInterfaceFunctionSolverDefined()" <<
"\n";
69 BCInterfaceFunctionSolverDefined< BCHandler, StructuralOperator<RegionMesh <LinearTetra> > >::exportData ( dataPtr_Type& data )
72 #ifdef HAVE_LIFEV_DEBUG 73 debugStream ( 5025 ) <<
"BCInterfaceFunctionSolverDefined::exportData" <<
"\n";
76 data->setName ( M_name );
77 data->setFlag ( M_flag );
78 data->setType ( M_type );
79 data->setMode ( M_mode );
80 data->setComponentsVector ( M_componentsVector );
87 #ifdef HAVE_LIFEV_DEBUG 88 debugStream ( 5025 ) <<
"BCInterfaceFunctionSolverDefined::updatePhysicalSolverVariables" <<
"\n";
91 switch ( M_solid3DFunction )
96 for ( UInt i ( 0 ); i < M_vectorFunctionRobin.size(); ++i )
98 functionParserSolverPtr_Type castedFunctionSolver = std::dynamic_pointer_cast< functionParserSolver_Type > ( M_vectorFunctionRobin[i] );
100 if ( castedFunctionSolver != 0 )
102 castedFunctionSolver->updatePhysicalSolverVariables();
110 Real t ( M_physicalSolver->data()->dataTime()->time() );
111 Real timeStep ( M_physicalSolver->data()->dataTime()->timeStep() );
113 Int verticesGlobalNumber ( M_physicalSolver->dispFESpace().mesh()->numGlobalVertices() );
114 for ( UInt i (0) ; i < M_physicalSolver->dispFESpace().mesh()->numVertices() ; ++i )
116 gid = M_physicalSolver->dispFESpace().mesh()->meshTransformer().pointInitial ( i ).id();
118 x = M_physicalSolver->dispFESpace().mesh()->meshTransformer().pointInitial ( i ).x();
119 y = M_physicalSolver->dispFESpace().mesh()->meshTransformer().pointInitial ( i ).y();
120 z = M_physicalSolver->dispFESpace().mesh()->meshTransformer().pointInitial ( i ).z();
122 alpha = M_vectorFunctionRobin[0]->functionTimeSpace ( t, x, y, z, 0 );
123 beta = M_vectorFunctionRobin[1]->functionTimeSpace ( t, x, y, z, 0 );
125 alpha += M_physicalSolver->timeAdvancePtr()->coefficientFirstDerivative ( 0 ) / timeStep * beta;
127 (*M_robinAlphaCoefficient) [gid] = alpha;
128 (*M_robinBetaCoefficient) [gid] = beta;
130 (*M_robinAlphaCoefficient) [gid + verticesGlobalNumber] = alpha;
131 (*M_robinBetaCoefficient) [gid + verticesGlobalNumber] = beta;
133 (*M_robinAlphaCoefficient) [gid + verticesGlobalNumber * 2] = alpha;
134 (*M_robinBetaCoefficient) [gid + verticesGlobalNumber * 2] = beta;
137 M_physicalSolver->timeAdvancePtr()->updateRHSFirstDerivative ( timeStep );
138 *M_robinRHS = M_physicalSolver->timeAdvancePtr()->rhsContributionFirstDerivative();
153 #ifdef HAVE_LIFEV_DEBUG 154 debugStream ( 5025 ) <<
"BCInterfaceFunctionSolverDefined::setData" <<
"\n";
158 std::map< std::string, Solid3DFunction > mapFunction;
159 mapFunction[
"RobinWall"] = RobinWall;
162 M_solid3DFunction = mapFunction[ data->baseString() ];
164 M_name = data->name();
165 M_flag = data->flag();
166 M_type = data->type();
167 M_mode = data->mode();
168 M_componentsVector = data->componentsVector();
170 if ( M_solid3DFunction == RobinWall )
172 factory_Type factory;
173 M_vectorFunctionRobin.reserve (2);
174 dataPtr_Type temporaryData (
new data_Type ( *data ) );
177 temporaryData->setRobinBaseAlpha();
178 M_vectorFunctionRobin.push_back ( factory.createFunctionParser ( temporaryData ) );
181 temporaryData->setRobinBaseBeta();
182 M_vectorFunctionRobin.push_back ( factory.createFunctionParser ( temporaryData ) );
192 BCInterfaceFunctionSolverDefined< BCHandler, StructuralOperator<RegionMesh <LinearTetra> > >::baseType()
const 194 switch ( M_solid3DFunction )
202 std::cout <<
" !!! Error: " << M_solid3DFunction <<
" is not available as a Solid3DFunction !!!" << std::endl;
213 BCInterfaceFunctionSolverDefined< BCHandler, StructuralOperator<RegionMesh <LinearTetra> > >::checkFunction ( BCVectorInterface& )
215 switch ( M_solid3DFunction )
219 std::cout <<
" !!! Error: " << M_solid3DFunction <<
" is not available as a BCVectorInterface !!!" << std::endl;
226 BCInterfaceFunctionSolverDefined< BCHandler, StructuralOperator<RegionMesh <LinearTetra> > >::checkFunction ( BCVector& base )
228 switch ( M_solid3DFunction )
232 #ifdef HAVE_LIFEV_DEBUG 233 debugStream ( 5025 ) <<
"BCInterfaceFunctionSolverDefined::checkFunction RobinWall" <<
"\n";
237 M_robinRHS.reset (
new physicalSolver_Type::vector_Type ( M_physicalSolver->dispFESpace().map(), Repeated, Zero ) );
238 M_robinAlphaCoefficient.reset (
new physicalSolver_Type::vector_Type ( M_physicalSolver->dispFESpace().map(), Repeated, Zero ) );
239 M_robinBetaCoefficient.reset (
new physicalSolver_Type::vector_Type ( M_physicalSolver->dispFESpace().map(), Repeated, Zero ) );
242 base.setRhsVector ( *M_robinRHS, M_physicalSolver->dispFESpace().dof().numTotalDof(), 0 );
243 base.setRobinCoeffVector ( *M_robinAlphaCoefficient );
244 base.setBetaCoeffVector ( *M_robinBetaCoefficient );
247 for ( UInt i ( 0 ); i < M_vectorFunctionRobin.size(); ++i )
249 functionParserSolverPtr_Type castedFunctionSolver = std::dynamic_pointer_cast< functionParserSolver_Type > ( M_vectorFunctionRobin[i] );
251 if ( castedFunctionSolver != 0 )
253 castedFunctionSolver->setPhysicalSolver ( M_physicalSolver );
261 std::cout <<
" !!! Error: " << M_solid3DFunction <<
" is not available as a BCVector !!!" << std::endl;
268 BCInterfaceFunctionSolverDefined< BCHandler, StructuralOperator<RegionMesh <LinearTetra> > >::checkFunction ( BCFunctionBase& )
270 switch ( M_solid3DFunction )
274 std::cout <<
" !!! Error: " << M_solid3DFunction <<
" is not available as a BCFunction !!!" << std::endl;
void setData(const std::shared_ptr< BCInterfaceData > &data)
void checkFunction(BCVectorInterface &base)
void updatePhysicalSolverVariables()