11#ifndef BELFEM_CL_FEM_CALCULATOR_HPP
12#define BELFEM_CL_FEM_CALCULATOR_HPP
180 bool mTClamped = false ;
184 bool mRhoClamped = false ;
226 bool mFrameCurrent = false ;
229 bool mHaveSeamT = false ;
241 Kernel * aThermalKernel ) ;
327 link_vector(
const string & aLabel );
333 compute_x_2d(
const uint aIndex );
336 compute_x_3d(
const uint aIndex );
342 compute_T_fem(
const uint aIndex ) ;
345 compute_T_const(
const uint aIndex ) ;
350 compute_T_side_connector(
const uint aIndex ) ;
353 compute_h_bulk_edge(
const uint aIndex ) ;
356 compute_h_ts_edge(
const uint aIndex ) ;
359 compute_h_bulk_node(
const uint aIndex ) ;
363 compute_h_side_connector(
const uint aIndex ) ;
368 prepare_side_connector_frame() ;
372 side_connector_xi_eta(
const real aPsi,
real & aXi,
real & aEta )
const ;
375 compute_mu_0(
const uint aIndex );
378 compute_mu_const(
const uint aIndex );
381 compute_mu_h(
const uint aIndex );
384 compute_b_bulk(
const uint aIndex ) ;
387 compute_b_ts(
const uint aIndex ) ;
390 compute_lambda_bulk(
const uint aIndex );
393 compute_dlambdadT_bulk(
const uint aIndex );
396 compute_lambda_metal(
const uint aIndex );
399 compute_dlambdadT_metal(
const uint aIndex );
403 compute_rho_bulk(
const uint aIndex );
406 compute_drhodT_bulk(
const uint aIndex );
409 compute_rho_metal(
const uint aIndex );
412 compute_drhodT_metal(
const uint aIndex );
415 compute_drhodb_metal(
const uint aIndex );
418 compute_drhodbeta_metal(
const uint aIndex );
428 compute_drhodb_powerlaw_ts(
const uint aIndex );
431 compute_drhodb_powerlaw_ts_defect(
const uint aIndex );
434 compute_drhodb_piecewise_ts(
const uint aIndex );
437 compute_drhodb_piecewise_ts_defect(
const uint aIndex );
440 compute_drhodb_powerlaw_bulk(
const uint aIndex );
443 compute_drhodb_powerlaw_bulk_defect(
const uint aIndex );
446 compute_drhodb_piecewise_bulk(
const uint aIndex );
449 compute_drhodb_piecewise_bulk_defect(
const uint aIndex );
458 compute_drhodT_powerlaw_ts(
const uint aIndex );
461 compute_drhodT_powerlaw_ts_defect(
const uint aIndex );
464 compute_drhodT_piecewise_ts(
const uint aIndex );
467 compute_drhodT_piecewise_ts_defect(
const uint aIndex );
470 compute_drhodT_powerlaw_bulk(
const uint aIndex );
473 compute_drhodT_powerlaw_bulk_defect(
const uint aIndex );
476 compute_drhodT_piecewise_bulk(
const uint aIndex );
479 compute_drhodT_piecewise_bulk_defect(
const uint aIndex );
484 compute_rho_riva_ts(
const uint aIndex );
487 compute_rho_riva_ts_defect(
const uint aIndex );
490 compute_rho_riva_bulk(
const uint aIndex );
493 compute_rho_riva_bulk_defect(
const uint aIndex );
496 compute_drhodj_riva_ts(
const uint aIndex );
499 compute_drhodj_riva_ts_defect(
const uint aIndex );
502 compute_drhodj_riva_bulk(
const uint aIndex );
505 compute_drhodj_riva_bulk_defect(
const uint aIndex );
508 compute_drhodb_riva_ts(
const uint aIndex );
511 compute_drhodb_riva_ts_defect(
const uint aIndex );
514 compute_drhodb_riva_bulk(
const uint aIndex );
517 compute_drhodb_riva_bulk_defect(
const uint aIndex );
520 compute_drhodT_riva_ts(
const uint aIndex );
523 compute_drhodT_riva_ts_defect(
const uint aIndex );
526 compute_drhodT_riva_bulk(
const uint aIndex );
529 compute_drhodT_riva_bulk_defect(
const uint aIndex );
532 compute_rho_powerlaw_bulk(
const uint aIndex );
535 compute_drhodj_powerlaw_bulk(
const uint aIndex );
538 compute_rho_powerlaw_ts(
const uint aIndex );
541 compute_drhodj_powerlaw_ts(
const uint aIndex );
544 compute_rho_piecewise_bulk(
const uint aIndex );
547 compute_drhodj_piecewise_bulk(
const uint aIndex );
550 compute_rho_piecewise_ts(
const uint aIndex );
553 compute_drhodj_piecewise_ts(
const uint aIndex );
556 compute_rho_powerlaw_bulk_defect(
const uint aIndex );
559 compute_drhodj_powerlaw_bulk_defect(
const uint aIndex );
562 compute_rho_powerlaw_ts_defect(
const uint aIndex );
565 compute_drhodj_powerlaw_ts_defect(
const uint aIndex );
568 compute_rho_piecewise_bulk_defect(
const uint aIndex );
571 compute_drhodj_piecewise_bulk_defect(
const uint aIndex );
574 compute_rho_piecewise_ts_defect(
const uint aIndex );
577 compute_drhodj_piecewise_ts_defect(
const uint aIndex );
580 return_zero(
const uint aIndex );
586 compute_dmu_zero(
const uint aIndex ) ;
589 compute_dmu_material(
const uint aIndex ) ;
592 compute_heatload_user(
const uint aIndex ) ;
602 Group * mGroup = nullptr ;
605 Mesh * mMesh = nullptr ;
610 const real & mTimestep ;
623 bool mIsAllocated = false ;
627 uint mNumberOfIntegrationPoints = 0 ;
651 bool mIsLinear = false ;
654 bool mIsCurved = false ;
726 Kernel * mMaxwellKernel = nullptr ;
727 Kernel * mThermalKernel = nullptr ;
769 (
Calculator::*mFunCollectNodeData )(
const string & aLabel );
776 real & norm_j )
const ;
780 real mOneMinusTheta = 0.0 ;
787 = & Calculator::link_element_default ;
789 uint mIntegrationOrder = 0 ;
792 index_t mMaxDofFieldIndex = 0 ;
926 vector(
const string & aLabel );
939 matrix(
const string & aLabel );
955 J(
const uint aIndex ) ;
987 N(
const uint aIndex ) ;
995 E(
const uint aIndex ) ;
1003 C(
const uint aIndex ) ;
1011 G(
const uint aIndex ) ;
1024 Em(
const uint aIndex ) ;
1032 Cm(
const uint aIndex ) ;
1040 Es(
const uint aIndex ) ;
1048 Cs(
const uint aIndex ) ;
1056 Nm(
const uint aIndex ) ;
1064 Ns(
const uint aIndex ) ;
1088 B(
const uint aIndex=0 ) ;
1096 Bm(
const uint aIndex=0 ) ;
1104 Bs(
const uint aIndex=0 ) ;
1128 dS (
const uint aIndex=0 ) ;
1136 dV (
const uint aIndex=0 ) ;
1226 const uint aNumRows,
1227 const uint aNumCols );
1262 bool & aMasterIsConductor,
1263 bool & aSlaveIsConductor ) ;
1316 Kernel * aThermalKernel =
nullptr ) ;
1324 real & norm_b,
real & norm_j )
const ;
1330 real & norm_b )
const ;
1341 return mEdgeFunction ;
1352 select_link_element_dispatcher();
1355 link_element_default(
Element * aElement );
1358 link_element_maxwell(
Element * aElement );
1361 link_element_maxwell_thermal(
Element * aElement );
1364 link_element_thermal_maxwell(
Element * aElement );
1374 slave_integration_index_2d(
const mesh::Facet * aFacet ) ;
1377 slave_integration_index_tet(
const mesh::Facet * aFacet ) ;
1380 slave_integration_index_hex(
const mesh::Facet * aFacet ) ;
1383 slave_integration_index_penta(
const mesh::Facet * aFacet ) ;
1389 Nscalar(
const uint aIndex ) ;
1395 Nscalar_master(
const uint aIndex ) ;
1401 Nscalar_slave(
const uint aIndex ) ;
1407 N2D(
const uint aIndex ) ;
1413 N3D(
const uint aIndex ) ;
1419 Bscalar(
const uint aIndex ) ;
1425 Bscalar_master(
const uint aIndex ) ;
1431 Bscalar_slave(
const uint aIndex ) ;
1437 Bplanestress(
const uint aIndex ) ;
1443 Bvoigt(
const uint aIndex ) ;
1448 normal_tri_straight(
const uint aIndex );
1453 normal_tri_curved(
const uint aIndex );
1458 normal_quad_straight(
const uint aIndex );
1463 normal_quad_curved(
const uint aIndex );
1468 normal_tet_straight(
const uint aIndex );
1473 normal_tet_curved(
const uint aIndex );
1478 normal_penta(
const uint aIndex );
1483 normal_hex(
const uint aIndex );
1488 dV_tri6_tet10(
const uint aIndex );
1493 dV_ts(
const uint aIndex );
1498 dV_quad4ts(
const uint aIndex );
1503 dV_hex(
const uint aIndex );
1508 dV_axsymmx(
const uint aIndex );
1513 dV_axsymmy(
const uint aIndex );
1518 dS_cartesian(
const uint aIndex );
1523 dS_axsymmx(
const uint aIndex );
1528 dS_axsymmy(
const uint aIndex );
1533 nedelec_data_linear_h();
1536 nedelec_data_quadratic_h_2d();
1539 nedelec_data_quadratic_h_3d();
1542 nedelec_data_linear_a();
1545 nedelec_data_quadratic_a_3d();
1553 nedelec_data_linear(
const string & aEdgeField );
1564 nedelec_data_quadratic_2d(
const string & aEdgeField,
1565 const string & aFaceField,
1566 const string & aVectorLabel );
1574 nedelec_data_quadratic_3d(
const string & aEdgeField,
1575 const string & aFaceField,
1576 const string & aVectorLabel );
1581 invJ2D3D(
const uint aIndex ) ;
1587 invJaxsym(
const uint aIndex ) ;
1599 inline const string &
1620 return mVectorData ;
1629 inline const string &
1652 return mMatrixData ;
1659 return mVectorMap.key_exists( aLabel );
1667 return mVectorMap( aLabel )->vector() ;
1674 return mMatrixMap.key_exists( aLabel );
1682 return mMatrixMap( aLabel )->matrix() ;
1714 if ( aIndex != mJ->index() )
1716 mJ->set_index( aIndex );
1717 mJ->matrix().matrix_data() = mIsCurved ?
1718 mDomainIntegration->dNdXi( aIndex ) * mX :
1719 mLinearIntegration->dNdXi( aIndex ) * mXc ;
1722 return mJ->matrix() ;
1730 if ( aIndex != mJm->index() )
1732 mJm->set_index( aIndex );
1733 mJm->matrix().matrix_data() =
1734 mMasterIntegration->dNdXi( aIndex ) * mXm ;
1737 return mJm->matrix() ;
1745 if ( aIndex != mJs->index() )
1747 mJs->set_index( aIndex );
1748 mJs->matrix().matrix_data() =
1749 mSlaveIntegration->dNdXi( aIndex ) * mXs ;
1752 return mJs->matrix() ;
1760 return ( this->*mFunInvJ )( aIndex );
1766 Calculator::invJ2D3D(
const uint aIndex )
1768 if ( aIndex != mInvJ->index() )
1771 mInvJ->set_index( aIndex );
1774 mDetJIndex = aIndex ;
1777 mDetJ = ( * mFunInvertJ )( this->J( aIndex ), mInvJ->matrix() );
1780 return mInvJ->matrix() ;
1785 inline const Matrix< real > &
1786 Calculator::invJaxsym(
const uint aIndex )
1788 if ( aIndex != mInvJ->index() )
1791 mInvJ->set_index( aIndex );
1794 ( * mFunInvertJ )( this->J( aIndex ), mInvJ->matrix() );
1797 return mInvJ->matrix() ;
1802 inline const Matrix< real > &
1803 Calculator::Nscalar(
const uint aIndex )
1805 return mDomainIntegration->N( aIndex );
1810 inline const Matrix< real > &
1811 Calculator::Nscalar_master(
const uint aIndex )
1813 return mMasterIntegration->N( aIndex );
1818 inline const Matrix< real > &
1819 Calculator::Nscalar_slave(
const uint aIndex )
1821 return mSlaveIntegration->N( aIndex );
1826 inline const Matrix< real > &
1827 Calculator::N2D(
const uint aIndex )
1829 if( mN->index() != aIndex )
1832 const Vector< real > & tPhi = mDomainIntegration->phi( aIndex );
1835 mN->set_index( aIndex );
1838 Matrix< real > & tN = mN->matrix() ;
1844 for(
uint k=0; k<mNumberOfNodes; ++k )
1846 tN( 0, tCount++ ) = tPhi( k );
1847 tN( 1, tCount++ ) = tPhi( k );
1850 return mN->matrix() ;
1855 inline const Matrix< real > &
1856 Calculator::N3D(
const uint aIndex )
1858 if( mN->index() != aIndex )
1861 const Vector< real > & tPhi = mDomainIntegration->phi( aIndex );
1864 mN->set_index( aIndex );
1867 Matrix< real > & tN = mN->matrix() ;
1873 for(
uint k=0; k<mNumberOfNodes; ++k )
1875 tN( 0, tCount++ ) = tPhi( k );
1876 tN( 1, tCount++ ) = tPhi( k );
1877 tN( 2, tCount++ ) = tPhi( k );
1880 return mN->matrix() ;
1885 inline const Matrix< real > &
1886 Calculator::Bscalar(
const uint aIndex )
1888 if ( aIndex != mB->index() )
1891 mB->set_index( aIndex );
1894 this->invJ( aIndex ) * mDomainIntegration->dNdXi( aIndex );
1897 return mB->matrix() ;
1903 inline const Matrix< real > &
1904 Calculator::Bscalar_master(
const uint aIndex )
1907 if ( aIndex != mBm->index() )
1910 mBm->set_index( aIndex );
1912 ( * mFunInvertJ )(this->Jm( aIndex ), mInvJm->matrix() ) ;
1914 mBm->matrix() =mInvJm->matrix() * mMasterIntegration->dNdXi( aIndex );
1917 return mBm->matrix() ;
1920 inline const Matrix< real > &
1921 Calculator::Bscalar_slave(
const uint aIndex )
1923 if ( aIndex != mBs->index() )
1926 mBs->set_index( aIndex );
1928 ( * mFunInvertJ )(this->Js( aIndex ), mInvJs->matrix() ) ;
1930 mBs->matrix() = mInvJs->matrix() * mSlaveIntegration->dNdXi( aIndex );
1933 return mBs->matrix() ;
1938 inline const Matrix< real > &
1939 Calculator::Bplanestress(
const uint aIndex )
1941 if ( aIndex != mB->index() )
1944 mB->set_index( aIndex );
1947 Matrix< real > & tdN = mdN->matrix() ;
1950 tdN = this->invJ( aIndex ) * mDomainIntegration->dNdXi( aIndex );
1953 Matrix< real > & tB = mB->matrix() ;
1959 for(
uint k=0; k<mNumberOfNodes; ++k )
1961 tB( 0, tCount ) = tdN( 0, k );
1962 tB( 2, tCount++ ) = tdN( 1, k );
1963 tB( 1, tCount ) = tdN( 1, k );
1964 tB( 2, tCount++ ) = tdN( 0, k );
1968 return mB->matrix() ;
1973 inline const Matrix< real > &
1974 Calculator::Bvoigt(
const uint aIndex )
1976 if ( aIndex != mB->index() )
1979 mB->set_index( aIndex );
1982 Matrix< real > & tdN = mdN->matrix() ;
1985 tdN = this->invJ( aIndex ) * mDomainIntegration->dNdXi( aIndex );
1988 Matrix< real > & tB = mB->matrix() ;
1994 for(
uint k=0; k<mNumberOfNodes; ++k )
1996 tB( 0, tCount ) = tdN( 0, k );
1997 tB( 4, tCount ) = tdN( 2, k );
1998 tB( 5, tCount ) = tdN( 1, k );
2001 tB( 1, tCount ) = tdN( 1, k );
2002 tB( 3, tCount ) = tdN( 2, k );
2003 tB( 5, tCount ) = tdN( 0, k );
2006 tB( 2, tCount ) = tdN( 2, k );
2007 tB( 3, tCount ) = tdN( 1, k );
2008 tB( 4, tCount ) = tdN( 0, k );
2013 return mB->matrix() ;
2018 inline const Matrix< real > &
2021 return ( this->*mFunN )( aIndex );
2029 return ( this->*mFunNm )( aIndex );
2037 return ( this->*mFunNs )( aIndex );
2045 return ( this->*mFunBm )( aIndex );
2053 return ( this->*mFunBs )( aIndex );
2061 return dot( mDomainIntegration->phi( aIndex ), aNodeValues );
2068 return mDomainIntegration->phi( aIndex ) ;
2076 return ( this->*mFunB )( aIndex );
2084 return ( this->*mFunNormal) ( aIndex );
2092#if !defined( NDEBUG ) || defined( DEBUG )
2093 real adS = ( this->*mFundS )( aIndex );
2094 BELFEM_ASSERT( adS >= 0.0,
"Negative Jacobian determinant" );
2097 return ( this->*mFundS )( aIndex );
2106#if !defined( NDEBUG ) || defined( DEBUG )
2107 real adV = ( this->*mFundV)( aIndex );
2108 BELFEM_ERROR( adV >= 0.0,
"Negative Jacobian determinant" );
2111 return ( this->*mFundV)( aIndex );
2119 Calculator::dV_tri6_tet10(
const uint aIndex )
2122 uint tIndex = mIsCurved ? aIndex : 0 ;
2124 if( mDetJIndex != tIndex )
2126 mDetJIndex = tIndex ;
2127 mDetJ =
det( this->J( tIndex ) );
2133 Calculator::dV_ts(
const uint aIndex )
2148 if (mEdgeFunction !=
nullptr)
2150 return mEdgeFunction->det_J() ;
2154 uint tIndex = mIsCurved ? aIndex : 0 ;
2156 if( mDetJIndex != tIndex )
2158 mDetJIndex = tIndex ;
2159 mDetJ =
det( this->J( tIndex ) );
2166 Calculator::dV_quad4ts(
const uint aIndex )
2208 return std::abs( this->dV_ts( aIndex ) );
2214 Calculator::dV_hex(
const uint aIndex )
2216 if ( mEdgeFunction !=
nullptr )
2218 mEdgeFunction->update_nabla( aIndex );
2219 return mEdgeFunction->det_J() ;
2224 if( mDetJIndex != aIndex )
2226 mDetJIndex = aIndex ;
2227 mDetJ =
det( this->J( aIndex ) );
2236 Calculator::dV_axsymmx(
const uint aIndex )
2238 if( mDetJIndex != aIndex )
2240 mDetJIndex = aIndex ;
2243 mDetJ = mIsCurved ?
dot(
2244 mDomainIntegration->phi( aIndex ).vector_data(), mX.col( 1 ) ) :
2245 dot( mLinearIntegration->
phi( aIndex ).vector_data(), mXc.col( 1 ) );
2255 Calculator::dV_axsymmy(
const uint aIndex )
2258 if( mDetJIndex != aIndex )
2260 mDetJIndex = aIndex ;
2263 mDetJ = mIsCurved ?
dot(
2264 mDomainIntegration->phi( aIndex ).vector_data(), mX.col( 0 ) ) :
2265 dot( mLinearIntegration->
phi( aIndex ).vector_data(), mXc.col( 0 ) );
2276 Calculator::dS_cartesian (
const uint aIndex )
2279 ( this->*mFunNormal ) ( aIndex );
2284 return mSurfaceIncrement ;
2290 Calculator::dS_axsymmx(
const uint aIndex )
2293 ( this->*mFunNormal ) ( aIndex );
2296 return dot( mMasterIntegration->phi( aIndex ).vector_data(),
2305 Calculator::dS_axsymmy(
const uint aIndex )
2308 ( this->*mFunNormal ) ( aIndex );
2311 return dot( mMasterIntegration->phi( aIndex ).vector_data(),
2319 inline const IntegrationData *
2322 return mDomainIntegration ;
2330 return mMasterIntegration ;
2338 return mSlaveIntegration ;
2346 return mMasterVolumeIntegration ;
2354 return mVolumeEnrichment ;
2362 return mSideSetEnrichment ;
2402 return mNumberOfIntegrationPoints ;
2417 mModelParameters = aParams ;
2425 return mModelParameters ;
2449 return (this->*mFunNedelecDataH )();
2457 return (this->*mFunNedelecDataA )();
2463 Calculator::nedelec_data_linear_h()
2465 return this->nedelec_data_linear(
"edge_h");
2471 Calculator::nedelec_data_linear_a()
2473 return this->nedelec_data_linear(
"edge_a");
2478 inline const Vector< real > &
2479 Calculator::nedelec_data_quadratic_h_2d()
2481 return this->nedelec_data_quadratic_2d(
2489 inline const Vector< real > &
2490 Calculator::nedelec_data_quadratic_h_3d()
2492 return this->nedelec_data_quadratic_3d(
2500 inline const Vector< real > &
2501 Calculator::nedelec_data_quadratic_a_3d()
2503 return this->nedelec_data_quadratic_3d(
2514 return mIntegrationOrder ;
2534 return ( this->*mFunBJAngle )( b, j, norm_b, norm_j );
2540 norm_b =
norm( b ) ;
2541 BELFEM_ASSERT( std::abs(
norm( n ) - 1.0 ) < 1e-6,
"tape normal must be normalized" ) ;
2553 std::acos( std::clamp(
dot( n, b ) / norm_b, -1.0, 1.0 ) ) ;
2559 norm_b =
norm( b ) ;
2560 norm_j =
norm( j ) ;
2563 return norm_b < 1e-6 || norm_j < 1e-6 ?
2564 constant::pi*0.5 : std::acos( std::min(std::abs(
dot( b, j ) / ( norm_b * norm_j ) ) , 1.0 )) ;
2570 norm_b =
norm( b ) ;
2571 norm_j =
norm( j ) ;
2578 inline Vector< real > &
2579 calculator::MaxwellData::link_vector(
const string & aLabel )
2581 if ( ! mMaxwellCalculator->vector_exists( aLabel ) )
2583 uint tNumDim = mMaxwellCalculator->mesh()->number_of_dimensions() ;
2587 if ( aLabel ==
"j" && tNumDim == 2 )
2592 VectorData * tData = mMaxwellCalculator->create_vector( aLabel, tNumDim );
2595 return mMaxwellCalculator->vector( aLabel );
2603 ( this->*mFunX )( aIndex );
2609 calculator::MaxwellData::compute_x_2d(
const uint aIndex )
2611 mCoords = mMaxwellCalculator->N( aIndex ) * mMaxwellCalculator->X();
2612 mX = mCoords( 0, 0 );
2613 mY = mCoords( 0, 1 );
2617 calculator::MaxwellData::compute_x_3d(
const uint aIndex )
2619 mCoords = mMaxwellCalculator->N( aIndex ) * mMaxwellCalculator->X();
2620 mX = mCoords( 0, 0 );
2621 mY = mCoords( 0, 1 );
2622 mZ = mCoords( 0, 2 );
2634 mJ = mMaxwellCalculator->C( aIndex ) * mMaxwellCalculator->q();
2672 const bool aIsConductor,
2690 for (
uint k = 0; k < tNumPoints; ++k )
2692 aScratch = ( aMaster ? aNormalCalc->
Em( k ) : aNormalCalc->
Es( k ) ) *
q ;
2693 aH += w( k ) * aScratch ;
2700 aH = -1. * ( aMaster ? aNormalCalc->
Bm( 0 ) : aNormalCalc->
Bs( 0 ) ) * aPhi ;
2720 BELFEM_ASSERT( aCalc->
element_is_linear(),
"compute_hn doesn't work for non-linear elements because it expects surface integration points but we integrate over the volume" );
2731 bool tMasterIsConductor ;
2732 bool tSlaveIsConductor ;
2735 phi_m, phi_s, tMasterIsConductor, tSlaveIsConductor );
2749 hn = 0.5 * ( hm + hs ) ;
2756 hn =
dot( hn, n ) * n ;
2762 Calculator::link_element_default( Element * aElement )
2764 mElement = aElement;
2775 mRhoClamped = false ;
2776 mFrameCurrent = false ;
2782 return mLastIndex(
static_cast< uint >( aValue ) ) == aIndex ;
2788 mLastIndex(
static_cast< uint >( aValue ) ) = aIndex ;
2797 return ( this->*mFunH )( aIndex );
2809 mMu = ( this->*mFunMu )( aIndex );
2815 calculator::MaxwellData::compute_mu_0(
const uint aIndex )
2821 calculator::MaxwellData::compute_mu_const(
const uint aIndex )
2827 calculator::MaxwellData::compute_mu_h(
const uint aIndex )
2831 mNormH =
norm( this->compute_h( aIndex ));
2834 return mMaterial->mu( mNormH );
2837 inline const Vector< real > &
2843 return ( this->*mFunB )( aIndex );
2849 calculator::MaxwellData::compute_b_bulk(
const uint aIndex )
2851 mB = this->compute_mu( aIndex ) * this->compute_h( aIndex ) ;
2856 calculator::MaxwellData::compute_b_ts(
const uint aIndex )
2858 this->compute_h( aIndex );
2859 real mu = this->compute_mu( aIndex );
2871 real tRho = ( this->*mFunRho )( aIndex );
2877 mRho = mRhoClamped ? std::clamp( tRho,
gRhoMin,
gRhoMax ) : tRho ;
2894 mdRhodJ = mRhoClamped ? 0.0 : ( this->*mFundRhodJ )( aIndex );
2919 mdRhodT = ( mTClamped || mRhoClamped ) ? 0.0 : ( this->*mFundRhodT )( aIndex );
2929 return ( this->*mFunT )( aIndex );
2937 mCp = mMaterial->cp( this->
compute_T( aIndex ) );
2951 mdCpdT = mTClamped ? 0.0 : mMaterial->dcpdT( T );
2962 mLambda = ( this->*mFunLambda)( aIndex );
2974 mdLambdadT = ( this->*mFundLambdadT)( aIndex );
2987 calculator::MaxwellData::compute_T_fem(
const uint aIndex )
2991 real T =
dot( mThermalCalculator->Nvec( aIndex ) , mThermalCalculator->q() ) ;
2998 mTClamped = ( T <
gTmin ) || ( T > mTmax ) ;
2999 mT = mTClamped ? std::clamp( T,
gTmin, mTmax ) : T ;
3007 calculator::MaxwellData::compute_T_const(
const uint aIndex )
3017 inline const Vector< real > &
3018 calculator::MaxwellData::compute_h_bulk_node(
const uint aIndex )
3020 mH = -1. * mMaxwellCalculator->B( aIndex ) * mMaxwellCalculator->q();
3024 inline const Vector< real > &
3025 calculator::MaxwellData::compute_h_bulk_edge(
const uint aIndex )
3027 mH = mMaxwellCalculator->E( aIndex ) * mMaxwellCalculator->q();
3031 inline const Vector< real > &
3032 calculator::MaxwellData::compute_h_ts_edge(
const uint aIndex )
3034 mHn =
compute_hn( mMaxwellCalculator, aIndex );
3036 mHt = mMaxwellCalculator->E( aIndex ) * mMaxwellCalculator->q();
3043 calculator::MaxwellData::compute_lambda_bulk(
const uint aIndex )
3045 return mMaterial->lambda( this->compute_T( aIndex ) );
3049 calculator::MaxwellData::compute_dlambdadT_bulk(
const uint aIndex )
3051 return mMaterial->dlambdadT( this->compute_T( aIndex ) );
3055 calculator::MaxwellData::compute_lambda_metal(
const uint aIndex )
3059 const Vector< real > & b = this->compute_b( aIndex );
3060 const Vector< real > &
j = this->compute_j( aIndex );
3063 mBeta = mMaxwellCalculator->bj_angle( b,
j, mNormB, mNormJ );
3070 return mMaterial->lambda( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3074 calculator::MaxwellData::compute_dlambdadT_metal(
const uint aIndex )
3078 const Vector< real > & b = this->compute_b( aIndex );
3079 const Vector< real > &
j = this->compute_j( aIndex );
3082 mBeta = mMaxwellCalculator->bj_angle( b,
j, mNormB, mNormJ );
3089 return mMaterial->dlambdadT( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3095 calculator::MaxwellData::compute_rho_bulk(
const uint aIndex )
3097 return mMaterial->rho( this->compute_T( aIndex ) );
3101 calculator::MaxwellData::compute_drhodT_bulk(
const uint aIndex )
3103 return mMaterial->drhodT( this->compute_T( aIndex ) );
3129 calculator::MaxwellData::compute_rho_metal(
const uint aIndex )
3137 mBeta = mMaxwellCalculator->bj_angle( b, j, mNormB, mNormJ );
3144 return mMaterial->rho( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3152 calculator::MaxwellData::compute_drhodT_powerlaw_ts(
const uint aIndex )
3160 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3166 return mMaterial->drho_powerlaw_dT(
3167 this->norm_j( aIndex ),
3168 this->compute_T( aIndex ),
3169 this->norm_b( aIndex ),
3174 calculator::MaxwellData::compute_drhodT_powerlaw_ts_defect(
const uint aIndex )
3178 const Vector< real > & b = this->compute_b( aIndex );
3182 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3188 this->compute_x( aIndex );
3190 return mMaterial->drho_powerlaw_dT(
3191 this->norm_j( aIndex ),
3192 this->compute_T( aIndex ),
3193 this->norm_b( aIndex ),
3195 mX, mY, mZ, mTime );
3199 calculator::MaxwellData::compute_drhodT_piecewise_ts(
const uint aIndex )
3203 const Vector< real > & b = this->compute_b( aIndex );
3207 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3213 return mMaterial->drho_piecewise_dT(
3214 this->norm_j( aIndex ),
3215 this->compute_T( aIndex ),
3216 this->norm_b( aIndex ),
3221 calculator::MaxwellData::compute_drhodT_piecewise_ts_defect(
const uint aIndex )
3225 const Vector< real > & b = this->compute_b( aIndex );
3229 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3235 this->compute_x( aIndex );
3237 return mMaterial->drho_piecewise_dT(
3238 this->norm_j( aIndex ),
3239 this->compute_T( aIndex ),
3240 this->norm_b( aIndex ),
3242 mX, mY, mZ, mTime );
3246 calculator::MaxwellData::compute_drhodT_powerlaw_bulk(
const uint aIndex )
3248 return mMaterial->drho_powerlaw_dT(
3249 this->norm_j( aIndex ),
3250 this->compute_T( aIndex ),
3251 this->norm_b( aIndex ),
3252 this->beta_dummy() );
3256 calculator::MaxwellData::compute_drhodT_powerlaw_bulk_defect(
const uint aIndex )
3258 this->compute_x( aIndex );
3260 return mMaterial->drho_powerlaw_dT(
3261 this->norm_j( aIndex ),
3262 this->compute_T( aIndex ),
3263 this->norm_b( aIndex ),
3265 mX, mY, mZ, mTime );
3269 calculator::MaxwellData::compute_drhodT_piecewise_bulk(
const uint aIndex )
3271 return mMaterial->drho_piecewise_dT(
3272 this->norm_j( aIndex ),
3273 this->compute_T( aIndex ),
3274 this->norm_b( aIndex ),
3275 this->beta_dummy() );
3279 calculator::MaxwellData::compute_drhodT_piecewise_bulk_defect(
const uint aIndex )
3281 this->compute_x( aIndex );
3283 return mMaterial->drho_piecewise_dT(
3284 this->norm_j( aIndex ),
3285 this->compute_T( aIndex ),
3286 this->norm_b( aIndex ),
3288 mX, mY, mZ, mTime );
3296 calculator::MaxwellData::compute_rho_riva_ts(
const uint aIndex )
3300 const Vector< real > & b = this->compute_b( aIndex );
3304 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3310 return mMaterial->rho_riva(
3311 this->norm_j( aIndex ),
3312 this->compute_T( aIndex ),
3313 this->norm_b( aIndex ),
3318 calculator::MaxwellData::compute_rho_riva_ts_defect(
const uint aIndex )
3322 const Vector< real > & b = this->compute_b( aIndex );
3326 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3332 this->compute_x( aIndex );
3334 return mMaterial->rho_riva(
3335 this->norm_j( aIndex ),
3336 this->compute_T( aIndex ),
3337 this->norm_b( aIndex ),
3339 mX, mY, mZ, mTime );
3343 calculator::MaxwellData::compute_rho_riva_bulk(
const uint aIndex )
3345 return mMaterial->rho_riva(
3346 this->norm_j( aIndex ),
3347 this->compute_T( aIndex ),
3348 this->norm_b( aIndex ),
3349 this->beta_dummy() );
3353 calculator::MaxwellData::compute_rho_riva_bulk_defect(
const uint aIndex )
3355 this->compute_x( aIndex );
3357 return mMaterial->rho_riva(
3358 this->norm_j( aIndex ),
3359 this->compute_T( aIndex ),
3360 this->norm_b( aIndex ),
3362 mX, mY, mZ, mTime );
3366 calculator::MaxwellData::compute_drhodj_riva_ts(
const uint aIndex )
3370 const Vector< real > & b = this->compute_b( aIndex );
3374 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3380 return mMaterial->drho_riva_dJ(
3381 this->norm_j( aIndex ),
3382 this->compute_T( aIndex ),
3383 this->norm_b( aIndex ),
3388 calculator::MaxwellData::compute_drhodj_riva_ts_defect(
const uint aIndex )
3392 const Vector< real > & b = this->compute_b( aIndex );
3396 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3402 this->compute_x( aIndex );
3404 return mMaterial->drho_riva_dJ(
3405 this->norm_j( aIndex ),
3406 this->compute_T( aIndex ),
3407 this->norm_b( aIndex ),
3409 mX, mY, mZ, mTime );
3413 calculator::MaxwellData::compute_drhodj_riva_bulk(
const uint aIndex )
3415 return mMaterial->drho_riva_dJ(
3416 this->norm_j( aIndex ),
3417 this->compute_T( aIndex ),
3418 this->norm_b( aIndex ),
3419 this->beta_dummy() );
3423 calculator::MaxwellData::compute_drhodj_riva_bulk_defect(
const uint aIndex )
3425 this->compute_x( aIndex );
3427 return mMaterial->drho_riva_dJ(
3428 this->norm_j( aIndex ),
3429 this->compute_T( aIndex ),
3430 this->norm_b( aIndex ),
3432 mX, mY, mZ, mTime );
3436 calculator::MaxwellData::compute_drhodb_riva_ts(
const uint aIndex )
3440 const Vector< real > & b = this->compute_b( aIndex );
3444 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3450 return mMaterial->drho_riva_dB(
3451 this->norm_j( aIndex ),
3452 this->compute_T( aIndex ),
3453 this->norm_b( aIndex ),
3458 calculator::MaxwellData::compute_drhodb_riva_ts_defect(
const uint aIndex )
3462 const Vector< real > & b = this->compute_b( aIndex );
3466 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3472 this->compute_x( aIndex );
3474 return mMaterial->drho_riva_dB(
3475 this->norm_j( aIndex ),
3476 this->compute_T( aIndex ),
3477 this->norm_b( aIndex ),
3479 mX, mY, mZ, mTime );
3483 calculator::MaxwellData::compute_drhodb_riva_bulk(
const uint aIndex )
3485 return mMaterial->drho_riva_dB(
3486 this->norm_j( aIndex ),
3487 this->compute_T( aIndex ),
3488 this->norm_b( aIndex ),
3489 this->beta_dummy() );
3493 calculator::MaxwellData::compute_drhodb_riva_bulk_defect(
const uint aIndex )
3495 this->compute_x( aIndex );
3497 return mMaterial->drho_riva_dB(
3498 this->norm_j( aIndex ),
3499 this->compute_T( aIndex ),
3500 this->norm_b( aIndex ),
3502 mX, mY, mZ, mTime );
3506 calculator::MaxwellData::compute_drhodT_riva_ts(
const uint aIndex )
3510 const Vector< real > & b = this->compute_b( aIndex );
3514 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3520 return mMaterial->drho_riva_dT(
3521 this->norm_j( aIndex ),
3522 this->compute_T( aIndex ),
3523 this->norm_b( aIndex ),
3528 calculator::MaxwellData::compute_drhodT_riva_ts_defect(
const uint aIndex )
3532 const Vector< real > & b = this->compute_b( aIndex );
3536 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3542 this->compute_x( aIndex );
3544 return mMaterial->drho_riva_dT(
3545 this->norm_j( aIndex ),
3546 this->compute_T( aIndex ),
3547 this->norm_b( aIndex ),
3549 mX, mY, mZ, mTime );
3553 calculator::MaxwellData::compute_drhodT_riva_bulk(
const uint aIndex )
3555 return mMaterial->drho_riva_dT(
3556 this->norm_j( aIndex ),
3557 this->compute_T( aIndex ),
3558 this->norm_b( aIndex ),
3559 this->beta_dummy() );
3563 calculator::MaxwellData::compute_drhodT_riva_bulk_defect(
const uint aIndex )
3565 this->compute_x( aIndex );
3567 return mMaterial->drho_riva_dT(
3568 this->norm_j( aIndex ),
3569 this->compute_T( aIndex ),
3570 this->norm_b( aIndex ),
3572 mX, mY, mZ, mTime );
3576 calculator::MaxwellData::compute_drhodT_metal(
const uint aIndex )
3580 const Vector< real > & b = this->compute_b( aIndex );
3581 const Vector< real > &
j = this->compute_j( aIndex );
3584 mBeta = mMaxwellCalculator->bj_angle( b,
j, mNormB, mNormJ );
3591 return mMaterial->drhodT( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3603 mdRhodB = mRhoClamped ? 0.0 : ( this->*mFundRhodB )( aIndex );
3618 mdRhodBeta = mRhoClamped ? 0.0 : ( this->*mFundRhodBeta )( aIndex );
3625 calculator::MaxwellData::compute_drhodb_metal(
const uint aIndex )
3633 mBeta = mMaxwellCalculator->bj_angle( b, j, mNormB, mNormJ );
3640 return mMaterial->drhodB( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3644 calculator::MaxwellData::compute_drhodbeta_metal(
const uint aIndex )
3652 mBeta = mMaxwellCalculator->bj_angle( b, j, mNormB, mNormJ );
3659 return mMaterial->drhodbeta( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3669 calculator::MaxwellData::compute_drhodb_powerlaw_ts(
const uint aIndex )
3673 const Vector< real > & b = this->compute_b( aIndex );
3677 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3683 return mMaterial->drho_powerlaw_dB(
3684 this->norm_j( aIndex ),
3685 this->compute_T( aIndex ),
3686 this->norm_b( aIndex ),
3691 calculator::MaxwellData::compute_drhodb_powerlaw_ts_defect(
const uint aIndex )
3695 const Vector< real > & b = this->compute_b( aIndex );
3699 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3705 this->compute_x( aIndex );
3707 return mMaterial->drho_powerlaw_dB(
3708 this->norm_j( aIndex ),
3709 this->compute_T( aIndex ),
3710 this->norm_b( aIndex ),
3712 mX, mY, mZ, mTime );
3716 calculator::MaxwellData::compute_drhodb_piecewise_ts(
const uint aIndex )
3720 const Vector< real > & b = this->compute_b( aIndex );
3724 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3730 return mMaterial->drho_piecewise_dB(
3731 this->norm_j( aIndex ),
3732 this->compute_T( aIndex ),
3733 this->norm_b( aIndex ),
3738 calculator::MaxwellData::compute_drhodb_piecewise_ts_defect(
const uint aIndex )
3742 const Vector< real > & b = this->compute_b( aIndex );
3746 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3752 this->compute_x( aIndex );
3754 return mMaterial->drho_piecewise_dB(
3755 this->norm_j( aIndex ),
3756 this->compute_T( aIndex ),
3757 this->norm_b( aIndex ),
3759 mX, mY, mZ, mTime );
3763 calculator::MaxwellData::compute_drhodb_powerlaw_bulk(
const uint aIndex )
3765 return mMaterial->drho_powerlaw_dB(
3766 this->norm_j( aIndex ),
3767 this->compute_T( aIndex ),
3768 this->norm_b( aIndex ),
3769 this->beta_dummy() );
3773 calculator::MaxwellData::compute_drhodb_powerlaw_bulk_defect(
const uint aIndex )
3775 this->compute_x( aIndex );
3777 return mMaterial->drho_powerlaw_dB(
3778 this->norm_j( aIndex ),
3779 this->compute_T( aIndex ),
3780 this->norm_b( aIndex ),
3782 mX, mY, mZ, mTime );
3786 calculator::MaxwellData::compute_drhodb_piecewise_bulk(
const uint aIndex )
3788 return mMaterial->drho_piecewise_dB(
3789 this->norm_j( aIndex ),
3790 this->compute_T( aIndex ),
3791 this->norm_b( aIndex ),
3792 this->beta_dummy() );
3796 calculator::MaxwellData::compute_drhodb_piecewise_bulk_defect(
const uint aIndex )
3798 this->compute_x( aIndex );
3800 return mMaterial->drho_piecewise_dB(
3801 this->norm_j( aIndex ),
3802 this->compute_T( aIndex ),
3803 this->norm_b( aIndex ),
3805 mX, mY, mZ, mTime );
3809 calculator::MaxwellData::compute_rho_powerlaw_bulk(
const uint aIndex )
3811 return mMaterial->rho_powerlaw(
3812 this->norm_j( aIndex ),
3813 this->compute_T( aIndex ),
3814 this->norm_b( aIndex ),
3815 this->beta_dummy() );
3819 calculator::MaxwellData::compute_rho_piecewise_bulk(
const uint aIndex )
3821 return mMaterial->rho_piecewise(
3822 this->norm_j( aIndex ),
3823 this->compute_T( aIndex ),
3824 this->norm_b( aIndex ),
3825 this->beta_dummy() );
3829 calculator::MaxwellData::compute_drhodj_powerlaw_bulk(
const uint aIndex )
3831 return mMaterial->drho_powerlaw_dJ(
3832 this->norm_j( aIndex ),
3833 this->compute_T( aIndex ),
3834 this->norm_b( aIndex ),
3835 this->beta_dummy() );
3839 calculator::MaxwellData::compute_drhodj_piecewise_bulk(
const uint aIndex )
3841 return mMaterial->drho_piecewise_dJ(
3842 this->norm_j( aIndex ),
3843 this->compute_T( aIndex ),
3844 this->norm_b( aIndex ),
3845 this->beta_dummy() );
3849 calculator::MaxwellData::compute_rho_powerlaw_ts(
const uint aIndex )
3854 const Vector< real > & b = this->compute_b( aIndex );
3858 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3864 return mMaterial->rho_powerlaw(
3865 this->norm_j( aIndex ),
3866 this->compute_T( aIndex ),
3867 this->norm_b( aIndex ),
3872 calculator::MaxwellData::compute_drhodj_powerlaw_ts(
const uint aIndex )
3877 const Vector< real > & b = this->compute_b( aIndex );
3881 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3887 return mMaterial->drho_powerlaw_dJ(
3888 this->norm_j( aIndex ),
3889 this->compute_T( aIndex ),
3890 this->norm_b( aIndex ),
3895 calculator::MaxwellData::compute_rho_piecewise_ts(
const uint aIndex )
3900 const Vector< real > & b = this->compute_b( aIndex );
3904 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3910 return mMaterial->rho_piecewise(
3911 this->norm_j( aIndex ),
3912 this->compute_T( aIndex ),
3913 this->norm_b( aIndex ),
3918 calculator::MaxwellData::compute_drhodj_piecewise_ts(
const uint aIndex )
3923 const Vector< real > & b = this->compute_b( aIndex );
3927 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3933 return mMaterial->drho_piecewise_dJ(
3934 this->norm_j( aIndex ),
3935 this->compute_T( aIndex ),
3936 this->norm_b( aIndex ),
3941 calculator::MaxwellData::compute_rho_powerlaw_bulk_defect(
const uint aIndex )
3943 this->compute_x( aIndex );
3945 return mMaterial->rho_powerlaw(
3946 this->norm_j( aIndex ),
3947 this->compute_T( aIndex ),
3948 this->norm_b( aIndex ),
3950 mX, mY, mZ, mTime );
3954 calculator::MaxwellData::compute_drhodj_powerlaw_bulk_defect(
const uint aIndex )
3956 this->compute_x( aIndex );
3958 return mMaterial->drho_powerlaw_dJ(
3959 this->norm_j( aIndex ),
3960 this->compute_T( aIndex ),
3961 this->norm_b( aIndex ),
3963 mX, mY, mZ, mTime );
3967 calculator::MaxwellData::compute_rho_powerlaw_ts_defect(
const uint aIndex )
3972 const Vector< real > & b = this->compute_b( aIndex );
3976 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3982 this->compute_x( aIndex );
3984 return mMaterial->rho_powerlaw(
3985 this->norm_j( aIndex ),
3986 this->compute_T( aIndex ),
3987 this->norm_b( aIndex ),
3989 mX, mY, mZ, mTime );
3993 calculator::MaxwellData::compute_drhodj_powerlaw_ts_defect(
const uint aIndex )
3998 const Vector< real > & b = this->compute_b( aIndex );
4002 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
4008 this->compute_x( aIndex );
4010 return mMaterial->drho_powerlaw_dJ(
4011 this->norm_j( aIndex ),
4012 this->compute_T( aIndex ),
4013 this->norm_b( aIndex ),
4015 mX, mY, mZ, mTime );
4019 calculator::MaxwellData::compute_rho_piecewise_bulk_defect(
const uint aIndex )
4021 this->compute_x( aIndex );
4022 return mMaterial->rho_piecewise(
4023 this->norm_j( aIndex ),
4024 this->compute_T( aIndex ),
4025 this->norm_b( aIndex ),
4027 mX, mY, mZ, mTime );
4031 calculator::MaxwellData::compute_drhodj_piecewise_bulk_defect(
const uint aIndex )
4033 this->compute_x( aIndex );
4034 return mMaterial->drho_piecewise_dJ(
4035 this->norm_j( aIndex ),
4036 this->compute_T( aIndex ),
4037 this->norm_b( aIndex ),
4039 mX, mY, mZ, mTime );
4043 calculator::MaxwellData::compute_rho_piecewise_ts_defect(
const uint aIndex )
4048 const Vector< real > & b = this->compute_b( aIndex );
4052 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
4058 this->compute_x( aIndex );
4060 return mMaterial->rho_piecewise(
4061 this->norm_j( aIndex ),
4062 this->compute_T( aIndex ),
4063 this->norm_b( aIndex ),
4070 calculator::MaxwellData::compute_drhodj_piecewise_ts_defect(
const uint aIndex )
4075 const Vector< real > & b = this->compute_b( aIndex );
4079 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
4085 this->compute_x( aIndex );
4087 return mMaterial->drho_piecewise_dJ(
4088 this->norm_j( aIndex ),
4089 this->compute_T( aIndex ),
4090 this->norm_b( aIndex ),
4092 mX, mY, mZ, mTime );
4101 return ( this->*mFundMudH ) ( aIndex );
4108 calculator::MaxwellData::compute_dmu_zero(
const uint aIndex )
4115 calculator::MaxwellData::compute_dmu_material(
const uint aIndex )
4119 mNormH =
norm( this->compute_h( aIndex ) );
4122 mMaterial->dmudH( mNormH, mMu, mdMudH );
4130 return ( this->*mFunHeat )( aIndex );
4134 calculator::MaxwellData::compute_heatload_user(
const uint aIndex )
4136 this->compute_x( aIndex );
4138 return mMaterial->volumetric_heatload( mX, mY, mZ, mTime );
4142 calculator::MaxwellData::return_zero(
const uint aIndex )
4148 calculator::MaxwellData::beta_dummy()
const
4156 "bulk-HTS dummy beta was polluted ( expected pi/2 )" );
4164 "material %s provides neither density nor ref_density",
4165 mMaterial->label().c_str() );
4178 return mRhoClamped ;
4184 return mMaxwellCalculator ;
4190 return mThermalCalculator ;
4196 BELFEM_ASSERT( mMaxwellData !=
nullptr,
"MaxwellData has not been initialized" );
4197 return mMaxwellData ;
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Base class for all materials in BELFEM.
Definition cl_Material.hpp:279
Top-level container for all mesh entities.
Definition cl_Mesh.hpp:60
void fill(const T &aValue)
write value into all entries of the vector
Definition cl_AR_Vector.hpp:226
Definition cl_FEM_Calculator.hpp:600
Matrix< real > & M()
return the mass matrix
Definition cl_FEM_Calculator.hpp:2376
const IntegrationData * master_integration() const
Definition cl_FEM_Calculator.hpp:2328
const Vector< real > & nedelec_data_slave_h()
slave twin of nedelec_data_master_h(), into vector( "nedelec_h_s" )
Definition cl_FEM_Calculator.cpp:2201
const IntegrationData * slave_integration() const
Definition cl_FEM_Calculator.hpp:2336
const Matrix< real > & Cs(const uint aIndex)
curl interpolator on slave
Definition cl_FEM_Calculator.cpp:3096
real timestep() const
Definition cl_FEM_Calculator.hpp:2408
const Matrix< real > & G(const uint aIndex)
gradient interpolator for nedelec elements
Definition cl_FEM_Calculator.cpp:3032
void link(Group *aGroup)
Definition cl_FEM_Calculator.cpp:1766
const Matrix< real > & Cm(const uint aIndex)
curl interpolator on master
Definition cl_FEM_Calculator.cpp:3074
bool volume_is_conductor(const mesh::Element *aVolume) const
true if the volume element sits on an h-conductor block ( DomainType::Conductor ),...
Definition cl_FEM_Calculator.cpp:2055
void initialize_integration(const ElementType aElementType, const InterpolationType aInterpolationType)
Definition cl_FEM_Calculator.cpp:893
void print_dofs()
Definition cl_FEM_Calculator.cpp:2128
uint integration_order() const
Definition cl_FEM_Calculator.hpp:2512
real dS(const uint aIndex=0)
surface increment
Definition cl_FEM_Calculator.hpp:2090
const Matrix< real > & Es(const uint aIndex)
edge interpolator on slave
Definition cl_FEM_Calculator.cpp:3085
real node_interp(const uint aIndex, const Vector< real > &aNodeValues) const
node interpolation function for local values
Definition cl_FEM_Calculator.hpp:2059
void allocate_memory()
Definition cl_FEM_Calculator.cpp:950
Matrix< real > & K()
return the stiffness matrix
Definition cl_FEM_Calculator.hpp:2368
Matrix< real > & matrix(const string &aLabel)
return a matrix object
Definition cl_FEM_Calculator.hpp:1680
const Vector< real > & Nvec(const uint aIndex) const
node interpolator, but as vector
Definition cl_FEM_Calculator.hpp:2066
const Matrix< real > & Xm() const
node coordinates on master element
Definition cl_FEM_Calculator.hpp:1696
const Matrix< real > & invJ(const uint aIndex)
inverse of jacobian matrix
Definition cl_FEM_Calculator.hpp:1758
void allocate()
called by dof manager
Definition cl_FEM_Calculator.cpp:1204
void link_maxwell(Kernel *aMaxwellKernel, Kernel *aThermalKernel=nullptr)
register the kernels for the maxwell data helper.
Definition cl_FEM_Calculator.cpp:1733
const Matrix< real > & Nm(const uint aIndex)
node interpolator master
Definition cl_FEM_Calculator.hpp:2027
const Matrix< real > & Em(const uint aIndex)
edge interpolator on master
Definition cl_FEM_Calculator.cpp:3063
bool element_is_linear() const
Definition cl_FEM_Calculator.hpp:2526
const IntegrationData * integration() const
Definition cl_FEM_Calculator.hpp:2320
bool matrix_exists(const string aLabel) const
Definition cl_FEM_Calculator.hpp:1672
const Material * material() const
Definition cl_FEM_Calculator.cpp:3107
void set_integration_order(const uint aOrder)
Definition cl_FEM_Calculator.cpp:916
calculator::MatrixData * create_matrix(const string &aLabel, const uint aNumRows, const uint aNumCols)
Definition cl_FEM_Calculator.cpp:2094
const Matrix< real > & Ns(const uint aIndex)
node interpolator slave
Definition cl_FEM_Calculator.hpp:2035
Vector< real > & qswap()
return a swap vector for the dofs
Definition cl_FEM_Calculator.cpp:2987
void init_qold_table()
Definition cl_FEM_Calculator.cpp:2922
const Vector< real > & normal(const uint aIndex=0)
returns the normal of a surface
Definition cl_FEM_Calculator.hpp:2082
Group * group()
Definition cl_FEM_Calculator.hpp:2439
uint num_intpoints() const
Definition cl_FEM_Calculator.hpp:2400
void set_model_parameters(const Vector< real > &aParams)
Definition cl_FEM_Calculator.hpp:2415
real bn_angle(const Vector< real > &b, const Vector< real > &n, real &norm_b) const
Definition cl_FEM_Calculator.hpp:2538
const IntegrationData * volume_integration() const
Definition cl_FEM_Calculator.hpp:2344
const Matrix< real > & B(const uint aIndex=0)
gradient operator
Definition cl_FEM_Calculator.hpp:2074
const Matrix< real > & C(const uint aIndex)
curl interpolator
Definition cl_FEM_Calculator.cpp:3020
const Matrix< real > & E(const uint aIndex)
edge interpolator
Definition cl_FEM_Calculator.cpp:3008
Matrix< real > & JN()
return the Newton correction matrix
Definition cl_FEM_Calculator.hpp:2384
const Matrix< real > & Xs() const
node coordinates on slave element
Definition cl_FEM_Calculator.hpp:1704
const Matrix< real > & Jm(const uint aIndex)
jacobian matrix for master
Definition cl_FEM_Calculator.hpp:1728
Element * element()
Definition cl_FEM_Calculator.hpp:2431
void print_local_dofs()
Definition cl_FEM_Calculator.cpp:2136
const Vector< real > & node_data(const string &aNodeField)
return a vector object
Definition cl_FEM_Calculator.cpp:2884
const IntegrationData * volume_enrichment() const
Definition cl_FEM_Calculator.hpp:2352
const Vector< real > & nedelec_data_master_h()
edge dofs of the master volume of the linked facet, read from the edge_h mesh field ( the live dof st...
Definition cl_FEM_Calculator.cpp:2171
real bj_angle(const Vector< real > &b, const Vector< real > &j, real &norm_b, real &norm_j) const
Definition cl_FEM_Calculator.hpp:2532
bool vector_exists(const string aLabel) const
Definition cl_FEM_Calculator.hpp:1657
uint num_nedelec_dofs() const
Definition cl_FEM_Calculator.cpp:3044
Vector< real > & vector(const string &aLabel)
return a vector object
Definition cl_FEM_Calculator.hpp:1665
const Matrix< real > & J(const uint aIndex)
jacobian matrix
Definition cl_FEM_Calculator.hpp:1712
const Vector< real > & qold(const uint aStep=0)
return the dof vector at an old timestep
Definition cl_FEM_Calculator.cpp:2894
const Vector< real > & nedelec_data_h()
Definition cl_FEM_Calculator.hpp:2447
const Matrix< real > & X() const
node coordinates on element
Definition cl_FEM_Calculator.hpp:1688
const Vector< real > & nedelec_data_a()
Definition cl_FEM_Calculator.hpp:2455
EdgeFunction * edge_function()
Definition cl_FEM_Calculator.hpp:1339
Mesh * mesh()
Definition cl_FEM_Calculator.hpp:2519
const Matrix< real > & Bs(const uint aIndex=0)
gradient operator slave
Definition cl_FEM_Calculator.hpp:2051
Calculator(Group *aGroup, const ModelDimensionality aDimensionality)
default constructor
Definition cl_FEM_Calculator.cpp:825
const Matrix< real > & Bm(const uint aIndex=0)
gradient operator master
Definition cl_FEM_Calculator.hpp:2043
Vector< real > & f()
return the load vector
Definition cl_FEM_Calculator.hpp:2392
real dV(const uint aIndex=0)
volume increment
Definition cl_FEM_Calculator.hpp:2104
const IntegrationData * sideset_enrichment() const
Definition cl_FEM_Calculator.hpp:2360
const Matrix< real > & Js(const uint aIndex)
jacobian matrix for slave
Definition cl_FEM_Calculator.hpp:1743
calculator::MaxwellData * maxwell()
Definition cl_FEM_Calculator.hpp:4194
const Vector< real > & model_parameters() const
Definition cl_FEM_Calculator.hpp:2423
calculator::VectorData * create_vector(const string &aLabel, const uint aSize, const EntityType aType=EntityType::UNDEFINED)
Definition cl_FEM_Calculator.cpp:2063
const Vector< real > & q()
return the dof vector at current timestep
Definition cl_FEM_Calculator.cpp:2995
const Matrix< real > & N(const uint aIndex)
node interpolator
Definition cl_FEM_Calculator.hpp:2019
Calculator * get_normal_calculator(Vector< real > &aPhiM, Vector< real > &aPhiS, bool &aMasterIsConductor, bool &aSlaveIsConductor)
links the tape-sideset calculator to the facet of the linked layer element and returns it.
Definition cl_FEM_Calculator.cpp:1985
the edge function base class
Definition cl_EF_EdgeFunction.hpp:32
Definition cl_FEM_Element.hpp:41
Definition cl_FEM_Group.hpp:45
Precomputed bundle of integration points, weights and shape-function values.
Definition cl_IF_IntegrationData.hpp:28
const Vector< real > & weights() const
return the integration weights
Definition cl_IF_IntegrationData.hpp:266
Top-level orchestrator; owns the mesh, materials, boundary conditions and DOF managers.
Definition cl_FEM_Kernel.hpp:50
Definition cl_FEM_Calculator.hpp:79
void set_index(const uint aIndex)
Definition cl_FEM_Calculator.hpp:1636
const string & label() const
Definition cl_FEM_Calculator.hpp:1630
uint index() const
Definition cl_FEM_Calculator.hpp:1642
Matrix< real > & matrix()
Definition cl_FEM_Calculator.hpp:1650
MatrixData(const string &aLabel, const uint aNumRows, const uint aNumCols)
Definition cl_FEM_Calculator.cpp:56
Definition cl_FEM_Calculator.hpp:132
real compute_lambda(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2958
real compute_cp(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2933
real compute_dlambdadT(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2969
real compute_drhodbeta(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3610
const Vector< real > & compute_h(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2792
const Vector< real > & compute_b(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2838
bool T_clamped() const
Definition cl_FEM_Calculator.hpp:4170
Calculator * maxwell()
Definition cl_FEM_Calculator.hpp:4182
real density() const
Definition cl_FEM_Calculator.hpp:4161
void reset()
Definition cl_FEM_Calculator.hpp:2770
real compute_drhodj(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2886
real compute_T(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2927
real compute_drhodb(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3595
real compute_dmudh(const uint aIndex)
Definition cl_FEM_Calculator.hpp:4096
real norm_b(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3107
const Vector< real > & compute_j(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2626
void compute_x(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2599
real compute_rho(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2867
real compute_dcpdT(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2944
bool rho_clamped() const
Definition cl_FEM_Calculator.hpp:4176
real compute_drhodT(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2901
Calculator * thermal()
Definition cl_FEM_Calculator.hpp:4188
real norm_j(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3118
real compute_mu(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2804
MaxwellData(Calculator *aCalculator, Kernel *aMaxwellKernel, Kernel *aThermalKernel)
Definition cl_FEM_Calculator.cpp:66
real compute_volumetric_heatload(const uint aIndex)
artificial volumetric heat load [ W/m³ ] at integration point aIndex, from the material's heating plu...
Definition cl_FEM_Calculator.hpp:4128
Definition cl_FEM_Calculator.hpp:49
const string & label() const
Definition cl_FEM_Calculator.hpp:1600
Vector< real > & vector()
Definition cl_FEM_Calculator.hpp:1618
EntityType entity_type() const
Definition cl_FEM_Calculator.hpp:1624
VectorData(const string &aLabel, const uint aSize, const EntityType aType)
Definition cl_FEM_Calculator.cpp:45
void set_index(const uint aIndex)
Definition cl_FEM_Calculator.hpp:1606
uint index() const
Definition cl_FEM_Calculator.hpp:1612
Definition cl_Facet.hpp:24
Determinant of a square matrix.
Inner products of vectors and matrices.
Closed-form inverse of a 2x2 matrix.
Closed-form inverse of a 3x3 matrix.
Euclidean length of a vector.
auto dot(const Vector< T > &aA, const Vector< T > &aB) -> decltype(arma::dot(aA.vector_data(), aB.vector_data()))
Scalar product of two vectors.
Definition fn_AR_dot.hpp:24
auto norm(const Vector< T > &aA) -> decltype(norm(aA.vector_data()))
Euclidean (L2) norm of a vector.
Definition fn_norm.hpp:56
const real phi
golden number
Definition constants.hpp:48
const real mu0
magnetic constant in V*s/(A*m) ( recommended value ) http://physics.nist.gov/cgi-bin/cuu/Value?...
Definition constants.hpp:73
const real pi
circle number
Definition constants.hpp:41
Definition cl_FEM_Calculator.cpp:42
MaxwellDataValue
Definition cl_FEM_Calculator.hpp:106
@ drhodbeta
Definition cl_FEM_Calculator.hpp:127
@ dlambdadT
Definition cl_FEM_Calculator.hpp:122
@ j
Definition cl_FEM_Calculator.hpp:110
@ normJ
Definition cl_FEM_Calculator.hpp:117
@ drhodT
Definition cl_FEM_Calculator.hpp:120
@ n
Definition cl_FEM_Calculator.hpp:118
@ rho
Definition cl_FEM_Calculator.hpp:111
@ normH
Definition cl_FEM_Calculator.hpp:115
@ mu
Definition cl_FEM_Calculator.hpp:124
@ dmudh
Definition cl_FEM_Calculator.hpp:125
@ lambda
Definition cl_FEM_Calculator.hpp:113
@ beta
Definition cl_FEM_Calculator.hpp:114
@ cp
Definition cl_FEM_Calculator.hpp:112
@ dcpdT
Definition cl_FEM_Calculator.hpp:121
@ B
Definition cl_FEM_Calculator.hpp:109
@ x
Definition cl_FEM_Calculator.hpp:123
@ drhodj
Definition cl_FEM_Calculator.hpp:119
@ normB
Definition cl_FEM_Calculator.hpp:116
@ T
Definition cl_FEM_Calculator.hpp:107
@ H
Definition cl_FEM_Calculator.hpp:108
@ drhodb
Definition cl_FEM_Calculator.hpp:126
Definition cl_IFB_LINE3.hpp:21
const Vector< real > & compute_hn(Calculator *aCalc, const uint k)
Computes the purely-normal magnetic field hn at the thin-shell facet: the average of the master and s...
Definition cl_FEM_Calculator.hpp:2713
void compute_h_trace(Calculator *aNormalCalc, const bool aMaster, const bool aIsConductor, const Vector< real > &aPhi, Vector< real > &aScratch, Vector< real > &aH)
Full field trace of one volume side of a thin-shell facet, for linear elements ( the k = 0 contract o...
Definition cl_FEM_Calculator.hpp:2669
USER GUIDES:
Definition cl_Capacitor.cpp:16
InterpolationType
Definition Mesh_Enums.hpp:99
greal gTbulk
Definition globals.hpp:45
unsigned int uint
Definition typedefs.hpp:30
ModelDimensionality
Definition en_IWGs.hpp:20
greal gRhoMin
minimim resistrivity in Ohm*m, default: 0
Definition globals.hpp:48
ElementType
Element types.
Definition Mesh_Enums.hpp:27
constexpr real gTmin
Definition typedefs.hpp:65
auto det(const T &A) -> decltype(arma::det(A))
Definition fn_AR_det.hpp:23
EntityType
Definition Mesh_Enums.hpp:116
@ UNDEFINED
Definition Mesh_Enums.hpp:124
@ q
Definition cl_Material.hpp:176
@ mu
Definition cl_Material.hpp:159
greal gRhoMax
maximim resistrivity in Ohm*m, default: 1e10
Definition globals.hpp:51
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_UINT_MAX
Definition typedefs.hpp:80
#define BELFEM_REAL_MAX
Definition typedefs.hpp:81
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87