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 );
427 compute_drhodb_powerlaw_ts(
const uint aIndex );
430 compute_drhodb_powerlaw_ts_defect(
const uint aIndex );
433 compute_drhodb_piecewise_ts(
const uint aIndex );
436 compute_drhodb_piecewise_ts_defect(
const uint aIndex );
439 compute_drhodb_powerlaw_bulk(
const uint aIndex );
442 compute_drhodb_powerlaw_bulk_defect(
const uint aIndex );
445 compute_drhodb_piecewise_bulk(
const uint aIndex );
448 compute_drhodb_piecewise_bulk_defect(
const uint aIndex );
454 compute_drhodT_powerlaw_ts(
const uint aIndex );
457 compute_drhodT_powerlaw_ts_defect(
const uint aIndex );
460 compute_drhodT_piecewise_ts(
const uint aIndex );
463 compute_drhodT_piecewise_ts_defect(
const uint aIndex );
466 compute_drhodT_powerlaw_bulk(
const uint aIndex );
469 compute_drhodT_powerlaw_bulk_defect(
const uint aIndex );
472 compute_drhodT_piecewise_bulk(
const uint aIndex );
475 compute_drhodT_piecewise_bulk_defect(
const uint aIndex );
480 compute_rho_riva_ts(
const uint aIndex );
483 compute_rho_riva_ts_defect(
const uint aIndex );
486 compute_rho_riva_bulk(
const uint aIndex );
489 compute_rho_riva_bulk_defect(
const uint aIndex );
492 compute_drhodj_riva_ts(
const uint aIndex );
495 compute_drhodj_riva_ts_defect(
const uint aIndex );
498 compute_drhodj_riva_bulk(
const uint aIndex );
501 compute_drhodj_riva_bulk_defect(
const uint aIndex );
504 compute_drhodb_riva_ts(
const uint aIndex );
507 compute_drhodb_riva_ts_defect(
const uint aIndex );
510 compute_drhodb_riva_bulk(
const uint aIndex );
513 compute_drhodb_riva_bulk_defect(
const uint aIndex );
516 compute_drhodT_riva_ts(
const uint aIndex );
519 compute_drhodT_riva_ts_defect(
const uint aIndex );
522 compute_drhodT_riva_bulk(
const uint aIndex );
525 compute_drhodT_riva_bulk_defect(
const uint aIndex );
528 compute_rho_powerlaw_bulk(
const uint aIndex );
531 compute_drhodj_powerlaw_bulk(
const uint aIndex );
534 compute_rho_powerlaw_ts(
const uint aIndex );
537 compute_drhodj_powerlaw_ts(
const uint aIndex );
540 compute_rho_piecewise_bulk(
const uint aIndex );
543 compute_drhodj_piecewise_bulk(
const uint aIndex );
546 compute_rho_piecewise_ts(
const uint aIndex );
549 compute_drhodj_piecewise_ts(
const uint aIndex );
552 compute_rho_powerlaw_bulk_defect(
const uint aIndex );
555 compute_drhodj_powerlaw_bulk_defect(
const uint aIndex );
558 compute_rho_powerlaw_ts_defect(
const uint aIndex );
561 compute_drhodj_powerlaw_ts_defect(
const uint aIndex );
564 compute_rho_piecewise_bulk_defect(
const uint aIndex );
567 compute_drhodj_piecewise_bulk_defect(
const uint aIndex );
570 compute_rho_piecewise_ts_defect(
const uint aIndex );
573 compute_drhodj_piecewise_ts_defect(
const uint aIndex );
576 return_zero(
const uint aIndex );
582 compute_dmu_zero(
const uint aIndex ) ;
585 compute_dmu_material(
const uint aIndex ) ;
588 compute_heatload_user(
const uint aIndex ) ;
598 Group * mGroup = nullptr ;
601 Mesh * mMesh = nullptr ;
606 const real & mTimestep ;
619 bool mIsAllocated = false ;
623 uint mNumberOfIntegrationPoints = 0 ;
647 bool mIsLinear = false ;
650 bool mIsCurved = false ;
723 Kernel * mMaxwellKernel = nullptr ;
724 Kernel * mThermalKernel = nullptr ;
766 (
Calculator::*mFunCollectNodeData )(
const string & aLabel );
773 real & norm_j )
const ;
777 real mOneMinusTheta = 0.0 ;
784 = & Calculator::link_element_default ;
786 uint mIntegrationOrder = 0 ;
789 index_t mMaxDofFieldIndex = 0 ;
923 vector(
const string & aLabel );
936 matrix(
const string & aLabel );
952 J(
const uint aIndex ) ;
984 N(
const uint aIndex ) ;
992 E(
const uint aIndex ) ;
1000 C(
const uint aIndex ) ;
1008 G(
const uint aIndex ) ;
1021 Em(
const uint aIndex ) ;
1029 Cm(
const uint aIndex ) ;
1037 Es(
const uint aIndex ) ;
1045 Cs(
const uint aIndex ) ;
1053 Nm(
const uint aIndex ) ;
1061 Ns(
const uint aIndex ) ;
1085 B(
const uint aIndex=0 ) ;
1093 Bm(
const uint aIndex=0 ) ;
1101 Bs(
const uint aIndex=0 ) ;
1125 dS (
const uint aIndex=0 ) ;
1133 dV (
const uint aIndex=0 ) ;
1233 const uint aNumRows,
1234 const uint aNumCols );
1269 bool & aMasterIsConductor,
1270 bool & aSlaveIsConductor ) ;
1323 Kernel * aThermalKernel =
nullptr ) ;
1331 real & norm_b,
real & norm_j )
const ;
1337 real & norm_b )
const ;
1348 return mEdgeFunction ;
1359 select_link_element_dispatcher();
1362 link_element_default(
Element * aElement );
1365 link_element_maxwell(
Element * aElement );
1368 link_element_maxwell_thermal(
Element * aElement );
1371 link_element_thermal_maxwell(
Element * aElement );
1381 slave_integration_index_2d(
const mesh::Facet * aFacet ) ;
1384 slave_integration_index_tet(
const mesh::Facet * aFacet ) ;
1387 slave_integration_index_hex(
const mesh::Facet * aFacet ) ;
1390 slave_integration_index_penta(
const mesh::Facet * aFacet ) ;
1396 Nscalar(
const uint aIndex ) ;
1402 Nscalar_master(
const uint aIndex ) ;
1408 Nscalar_slave(
const uint aIndex ) ;
1414 N2D(
const uint aIndex ) ;
1420 N3D(
const uint aIndex ) ;
1426 Bscalar(
const uint aIndex ) ;
1432 Bscalar_master(
const uint aIndex ) ;
1438 Bscalar_slave(
const uint aIndex ) ;
1444 Bplanestress(
const uint aIndex ) ;
1450 Bvoigt(
const uint aIndex ) ;
1455 normal_tri_straight(
const uint aIndex );
1460 normal_tri_curved(
const uint aIndex );
1465 normal_quad_straight(
const uint aIndex );
1470 normal_quad_curved(
const uint aIndex );
1475 normal_tet_straight(
const uint aIndex );
1480 normal_tet_curved(
const uint aIndex );
1485 normal_penta(
const uint aIndex );
1490 normal_hex(
const uint aIndex );
1495 dV_tri6_tet10(
const uint aIndex );
1500 dV_ts(
const uint aIndex );
1505 dV_quad4ts(
const uint aIndex );
1510 dV_hex(
const uint aIndex );
1515 dV_axsymmx(
const uint aIndex );
1520 dV_axsymmy(
const uint aIndex );
1525 dS_cartesian(
const uint aIndex );
1530 dS_axsymmx(
const uint aIndex );
1535 dS_axsymmy(
const uint aIndex );
1540 nedelec_data_linear_h();
1543 nedelec_data_quadratic_h_2d();
1546 nedelec_data_quadratic_h_3d();
1549 nedelec_data_linear_a();
1552 nedelec_data_quadratic_a_3d();
1560 nedelec_data_linear(
const string & aEdgeField );
1571 nedelec_data_quadratic_2d(
const string & aEdgeField,
1572 const string & aFaceField,
1573 const string & aVectorLabel );
1581 nedelec_data_quadratic_3d(
const string & aEdgeField,
1582 const string & aFaceField,
1583 const string & aVectorLabel );
1588 invJ2D3D(
const uint aIndex ) ;
1594 invJaxsym(
const uint aIndex ) ;
1606 inline const string &
1627 return mVectorData ;
1636 inline const string &
1659 return mMatrixData ;
1666 return mVectorMap.key_exists( aLabel );
1674 return mVectorMap( aLabel )->vector() ;
1681 return mMatrixMap.key_exists( aLabel );
1689 return mMatrixMap( aLabel )->matrix() ;
1721 if ( aIndex != mJ->index() )
1723 mJ->set_index( aIndex );
1724 mJ->matrix().matrix_data() = mIsCurved ?
1725 mDomainIntegration->dNdXi( aIndex ) * mX :
1726 mLinearIntegration->dNdXi( aIndex ) * mXc ;
1729 return mJ->matrix() ;
1737 if ( aIndex != mJm->index() )
1739 mJm->set_index( aIndex );
1740 mJm->matrix().matrix_data() =
1741 mMasterIntegration->dNdXi( aIndex ) * mXm ;
1744 return mJm->matrix() ;
1752 if ( aIndex != mJs->index() )
1754 mJs->set_index( aIndex );
1755 mJs->matrix().matrix_data() =
1756 mSlaveIntegration->dNdXi( aIndex ) * mXs ;
1759 return mJs->matrix() ;
1767 return ( this->*mFunInvJ )( aIndex );
1773 Calculator::invJ2D3D(
const uint aIndex )
1775 if ( aIndex != mInvJ->index() )
1778 mInvJ->set_index( aIndex );
1781 mDetJIndex = aIndex ;
1784 mDetJ = ( * mFunInvertJ )( this->J( aIndex ), mInvJ->matrix() );
1787 return mInvJ->matrix() ;
1792 inline const Matrix< real > &
1793 Calculator::invJaxsym(
const uint aIndex )
1795 if ( aIndex != mInvJ->index() )
1798 mInvJ->set_index( aIndex );
1801 ( * mFunInvertJ )( this->J( aIndex ), mInvJ->matrix() );
1804 return mInvJ->matrix() ;
1809 inline const Matrix< real > &
1810 Calculator::Nscalar(
const uint aIndex )
1812 return mDomainIntegration->N( aIndex );
1817 inline const Matrix< real > &
1818 Calculator::Nscalar_master(
const uint aIndex )
1820 return mMasterIntegration->N( aIndex );
1825 inline const Matrix< real > &
1826 Calculator::Nscalar_slave(
const uint aIndex )
1828 return mSlaveIntegration->N( aIndex );
1833 inline const Matrix< real > &
1834 Calculator::N2D(
const uint aIndex )
1836 if( mN->index() != aIndex )
1839 const Vector< real > & tPhi = mDomainIntegration->phi( aIndex );
1842 mN->set_index( aIndex );
1844 Matrix< real > & tN = mN->matrix() ;
1848 for(
uint k=0; k<mNumberOfNodes; ++k )
1850 tN( 0, tCount++ ) = tPhi( k );
1851 tN( 1, tCount++ ) = tPhi( k );
1854 return mN->matrix() ;
1859 inline const Matrix< real > &
1860 Calculator::N3D(
const uint aIndex )
1862 if( mN->index() != aIndex )
1865 const Vector< real > & tPhi = mDomainIntegration->phi( aIndex );
1868 mN->set_index( aIndex );
1870 Matrix< real > & tN = mN->matrix() ;
1874 for(
uint k=0; k<mNumberOfNodes; ++k )
1876 tN( 0, tCount++ ) = tPhi( k );
1877 tN( 1, tCount++ ) = tPhi( k );
1878 tN( 2, tCount++ ) = tPhi( k );
1881 return mN->matrix() ;
1886 inline const Matrix< real > &
1887 Calculator::Bscalar(
const uint aIndex )
1889 if ( aIndex != mB->index() )
1892 mB->set_index( aIndex );
1895 this->invJ( aIndex ) * mDomainIntegration->dNdXi( aIndex );
1898 return mB->matrix() ;
1904 inline const Matrix< real > &
1905 Calculator::Bscalar_master(
const uint aIndex )
1908 if ( aIndex != mBm->index() )
1911 mBm->set_index( aIndex );
1913 ( * mFunInvertJ )(this->Jm( aIndex ), mInvJm->matrix() ) ;
1915 mBm->matrix() =mInvJm->matrix() * mMasterIntegration->dNdXi( aIndex );
1918 return mBm->matrix() ;
1921 inline const Matrix< real > &
1922 Calculator::Bscalar_slave(
const uint aIndex )
1924 if ( aIndex != mBs->index() )
1927 mBs->set_index( aIndex );
1929 ( * mFunInvertJ )(this->Js( aIndex ), mInvJs->matrix() ) ;
1931 mBs->matrix() = mInvJs->matrix() * mSlaveIntegration->dNdXi( aIndex );
1934 return mBs->matrix() ;
1939 inline const Matrix< real > &
1940 Calculator::Bplanestress(
const uint aIndex )
1942 if ( aIndex != mB->index() )
1944 mB->set_index( aIndex );
1946 Matrix< real > & tdN = mdN->matrix() ;
1948 tdN = this->invJ( aIndex ) * mDomainIntegration->dNdXi( aIndex );
1950 Matrix< real > & tB = mB->matrix() ;
1954 for(
uint k=0; k<mNumberOfNodes; ++k )
1956 tB( 0, tCount ) = tdN( 0, k );
1957 tB( 2, tCount++ ) = tdN( 1, k );
1958 tB( 1, tCount ) = tdN( 1, k );
1959 tB( 2, tCount++ ) = tdN( 0, k );
1963 return mB->matrix() ;
1968 inline const Matrix< real > &
1969 Calculator::Bvoigt(
const uint aIndex )
1971 if ( aIndex != mB->index() )
1973 mB->set_index( aIndex );
1975 Matrix< real > & tdN = mdN->matrix() ;
1977 tdN = this->invJ( aIndex ) * mDomainIntegration->dNdXi( aIndex );
1979 Matrix< real > & tB = mB->matrix() ;
1983 for(
uint k=0; k<mNumberOfNodes; ++k )
1985 tB( 0, tCount ) = tdN( 0, k );
1986 tB( 4, tCount ) = tdN( 2, k );
1987 tB( 5, tCount ) = tdN( 1, k );
1990 tB( 1, tCount ) = tdN( 1, k );
1991 tB( 3, tCount ) = tdN( 2, k );
1992 tB( 5, tCount ) = tdN( 0, k );
1995 tB( 2, tCount ) = tdN( 2, k );
1996 tB( 3, tCount ) = tdN( 1, k );
1997 tB( 4, tCount ) = tdN( 0, k );
2002 return mB->matrix() ;
2007 inline const Matrix< real > &
2010 return ( this->*mFunN )( aIndex );
2018 return ( this->*mFunNm )( aIndex );
2026 return ( this->*mFunNs )( aIndex );
2034 return ( this->*mFunBm )( aIndex );
2042 return ( this->*mFunBs )( aIndex );
2050 return dot( mDomainIntegration->phi( aIndex ), aNodeValues );
2057 return mDomainIntegration->phi( aIndex ) ;
2065 return ( this->*mFunB )( aIndex );
2073 return ( this->*mFunNormal) ( aIndex );
2081#if !defined( NDEBUG ) || defined( DEBUG )
2082 real adS = ( this->*mFundS )( aIndex );
2083 BELFEM_ASSERT( adS >= 0.0,
"Negative Jacobian determinant" );
2086 return ( this->*mFundS )( aIndex );
2095#if !defined( NDEBUG ) || defined( DEBUG )
2096 real adV = ( this->*mFundV)( aIndex );
2097 BELFEM_ERROR( adV >= 0.0,
"Negative Jacobian determinant" );
2100 return ( this->*mFundV)( aIndex );
2108 Calculator::dV_tri6_tet10(
const uint aIndex )
2111 uint tIndex = mIsCurved ? aIndex : 0 ;
2113 if( mDetJIndex != tIndex )
2115 mDetJIndex = tIndex ;
2116 mDetJ =
det( this->J( tIndex ) );
2122 Calculator::dV_ts(
const uint aIndex )
2137 if (mEdgeFunction !=
nullptr)
2139 return mEdgeFunction->det_J() ;
2143 uint tIndex = mIsCurved ? aIndex : 0 ;
2145 if( mDetJIndex != tIndex )
2147 mDetJIndex = tIndex ;
2148 mDetJ =
det( this->J( tIndex ) );
2155 Calculator::dV_quad4ts(
const uint aIndex )
2197 return std::abs( this->dV_ts( aIndex ) );
2203 Calculator::dV_hex(
const uint aIndex )
2205 if ( mEdgeFunction !=
nullptr )
2207 mEdgeFunction->update_nabla( aIndex );
2208 return mEdgeFunction->det_J() ;
2213 if( mDetJIndex != aIndex )
2215 mDetJIndex = aIndex ;
2216 mDetJ =
det( this->J( aIndex ) );
2225 Calculator::dV_axsymmx(
const uint aIndex )
2227 if( mDetJIndex != aIndex )
2229 mDetJIndex = aIndex ;
2232 mDetJ = mIsCurved ?
dot(
2233 mDomainIntegration->phi( aIndex ).vector_data(), mX.col( 1 ) ) :
2234 dot( mLinearIntegration->
phi( aIndex ).vector_data(), mXc.col( 1 ) );
2244 Calculator::dV_axsymmy(
const uint aIndex )
2247 if( mDetJIndex != aIndex )
2249 mDetJIndex = aIndex ;
2252 mDetJ = mIsCurved ?
dot(
2253 mDomainIntegration->phi( aIndex ).vector_data(), mX.col( 0 ) ) :
2254 dot( mLinearIntegration->
phi( aIndex ).vector_data(), mXc.col( 0 ) );
2265 Calculator::dS_cartesian (
const uint aIndex )
2268 ( this->*mFunNormal ) ( aIndex );
2273 return mSurfaceIncrement ;
2279 Calculator::dS_axsymmx(
const uint aIndex )
2282 ( this->*mFunNormal ) ( aIndex );
2284 return dot( mMasterIntegration->phi( aIndex ).vector_data(),
2293 Calculator::dS_axsymmy(
const uint aIndex )
2296 ( this->*mFunNormal ) ( aIndex );
2298 return dot( mMasterIntegration->phi( aIndex ).vector_data(),
2306 inline const IntegrationData *
2309 return mDomainIntegration ;
2317 return mMasterIntegration ;
2325 return mSlaveIntegration ;
2333 return mMasterVolumeIntegration ;
2341 return mVolumeEnrichment ;
2349 return mSideSetEnrichment ;
2389 return mNumberOfIntegrationPoints ;
2404 mModelParameters = aParams ;
2412 return mModelParameters ;
2436 return (this->*mFunNedelecDataH )();
2444 return (this->*mFunNedelecDataA )();
2450 Calculator::nedelec_data_linear_h()
2452 return this->nedelec_data_linear(
"edge_h");
2458 Calculator::nedelec_data_linear_a()
2460 return this->nedelec_data_linear(
"edge_a");
2465 inline const Vector< real > &
2466 Calculator::nedelec_data_quadratic_h_2d()
2468 return this->nedelec_data_quadratic_2d(
2476 inline const Vector< real > &
2477 Calculator::nedelec_data_quadratic_h_3d()
2479 return this->nedelec_data_quadratic_3d(
2487 inline const Vector< real > &
2488 Calculator::nedelec_data_quadratic_a_3d()
2490 return this->nedelec_data_quadratic_3d(
2501 return mIntegrationOrder ;
2521 return ( this->*mFunBJAngle )( b, j, norm_b, norm_j );
2527 norm_b =
norm( b ) ;
2528 BELFEM_ASSERT( std::abs(
norm( n ) - 1.0 ) < 1e-6,
"tape normal must be normalized" ) ;
2540 std::acos( std::clamp(
dot( n, b ) / norm_b, -1.0, 1.0 ) ) ;
2546 norm_b =
norm( b ) ;
2547 norm_j =
norm( j ) ;
2550 return norm_b < 1e-6 || norm_j < 1e-6 ?
2551 constant::pi*0.5 : std::acos( std::min(std::abs(
dot( b, j ) / ( norm_b * norm_j ) ) , 1.0 )) ;
2557 norm_b =
norm( b ) ;
2558 norm_j =
norm( j ) ;
2565 inline Vector< real > &
2566 calculator::MaxwellData::link_vector(
const string & aLabel )
2568 if ( ! mMaxwellCalculator->vector_exists( aLabel ) )
2570 uint tNumDim = mMaxwellCalculator->mesh()->number_of_dimensions() ;
2574 if ( aLabel ==
"j" && tNumDim == 2 )
2579 VectorData * tData = mMaxwellCalculator->create_vector( aLabel, tNumDim );
2582 return mMaxwellCalculator->vector( aLabel );
2590 ( this->*mFunX )( aIndex );
2596 calculator::MaxwellData::compute_x_2d(
const uint aIndex )
2598 mCoords = mMaxwellCalculator->N( aIndex ) * mMaxwellCalculator->X();
2599 mX = mCoords( 0, 0 );
2600 mY = mCoords( 0, 1 );
2604 calculator::MaxwellData::compute_x_3d(
const uint aIndex )
2606 mCoords = mMaxwellCalculator->N( aIndex ) * mMaxwellCalculator->X();
2607 mX = mCoords( 0, 0 );
2608 mY = mCoords( 0, 1 );
2609 mZ = mCoords( 0, 2 );
2621 mJ = mMaxwellCalculator->C( aIndex ) * mMaxwellCalculator->q();
2659 const bool aIsConductor,
2677 for (
uint k = 0; k < tNumPoints; ++k )
2679 aScratch = ( aMaster ? aNormalCalc->
Em( k ) : aNormalCalc->
Es( k ) ) *
q ;
2680 aH += w( k ) * aScratch ;
2687 aH = -1. * ( aMaster ? aNormalCalc->
Bm( 0 ) : aNormalCalc->
Bs( 0 ) ) * aPhi ;
2707 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" );
2718 bool tMasterIsConductor ;
2719 bool tSlaveIsConductor ;
2722 phi_m, phi_s, tMasterIsConductor, tSlaveIsConductor );
2736 hn = 0.5 * ( hm + hs ) ;
2743 hn =
dot( hn, n ) * n ;
2749 Calculator::link_element_default( Element * aElement )
2751 mElement = aElement;
2762 mRhoClamped = false ;
2763 mFrameCurrent = false ;
2769 return mLastIndex(
static_cast< uint >( aValue ) ) == aIndex ;
2775 mLastIndex(
static_cast< uint >( aValue ) ) = aIndex ;
2784 return ( this->*mFunH )( aIndex );
2796 mMu = ( this->*mFunMu )( aIndex );
2802 calculator::MaxwellData::compute_mu_0(
const uint aIndex )
2808 calculator::MaxwellData::compute_mu_const(
const uint aIndex )
2814 calculator::MaxwellData::compute_mu_h(
const uint aIndex )
2818 mNormH =
norm( this->compute_h( aIndex ));
2821 return mMaterial->mu( mNormH );
2824 inline const Vector< real > &
2830 return ( this->*mFunB )( aIndex );
2836 calculator::MaxwellData::compute_b_bulk(
const uint aIndex )
2838 mB = this->compute_mu( aIndex ) * this->compute_h( aIndex ) ;
2843 calculator::MaxwellData::compute_b_ts(
const uint aIndex )
2845 this->compute_h( aIndex );
2846 real mu = this->compute_mu( aIndex );
2858 real tRho = ( this->*mFunRho )( aIndex );
2864 mRho = mRhoClamped ? std::clamp( tRho,
gRhoMin,
gRhoMax ) : tRho ;
2881 mdRhodJ = mRhoClamped ? 0.0 : ( this->*mFundRhodJ )( aIndex );
2906 mdRhodT = ( mTClamped || mRhoClamped ) ? 0.0 : ( this->*mFundRhodT )( aIndex );
2916 return ( this->*mFunT )( aIndex );
2924 mCp = mMaterial->cp( this->
compute_T( aIndex ) );
2938 mdCpdT = mTClamped ? 0.0 : mMaterial->dcpdT( T );
2949 mLambda = ( this->*mFunLambda)( aIndex );
2961 mdLambdadT = ( this->*mFundLambdadT)( aIndex );
2974 calculator::MaxwellData::compute_T_fem(
const uint aIndex )
2978 real T =
dot( mThermalCalculator->Nvec( aIndex ) , mThermalCalculator->q() ) ;
2985 mTClamped = ( T <
gTmin ) || ( T > mTmax ) ;
2986 mT = mTClamped ? std::clamp( T,
gTmin, mTmax ) : T ;
2994 calculator::MaxwellData::compute_T_const(
const uint aIndex )
3004 inline const Vector< real > &
3005 calculator::MaxwellData::compute_h_bulk_node(
const uint aIndex )
3007 mH = -1. * mMaxwellCalculator->B( aIndex ) * mMaxwellCalculator->q();
3011 inline const Vector< real > &
3012 calculator::MaxwellData::compute_h_bulk_edge(
const uint aIndex )
3014 mH = mMaxwellCalculator->E( aIndex ) * mMaxwellCalculator->q();
3018 inline const Vector< real > &
3019 calculator::MaxwellData::compute_h_ts_edge(
const uint aIndex )
3021 mHn =
compute_hn( mMaxwellCalculator, aIndex );
3023 mHt = mMaxwellCalculator->E( aIndex ) * mMaxwellCalculator->q();
3030 calculator::MaxwellData::compute_lambda_bulk(
const uint aIndex )
3032 return mMaterial->lambda( this->compute_T( aIndex ) );
3036 calculator::MaxwellData::compute_dlambdadT_bulk(
const uint aIndex )
3038 return mMaterial->dlambdadT( this->compute_T( aIndex ) );
3042 calculator::MaxwellData::compute_lambda_metal(
const uint aIndex )
3046 const Vector< real > & b = this->compute_b( aIndex );
3047 const Vector< real > &
j = this->compute_j( aIndex );
3050 mBeta = mMaxwellCalculator->bj_angle( b,
j, mNormB, mNormJ );
3057 return mMaterial->lambda( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3061 calculator::MaxwellData::compute_dlambdadT_metal(
const uint aIndex )
3065 const Vector< real > & b = this->compute_b( aIndex );
3066 const Vector< real > &
j = this->compute_j( aIndex );
3069 mBeta = mMaxwellCalculator->bj_angle( b,
j, mNormB, mNormJ );
3076 return mMaterial->dlambdadT( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3082 calculator::MaxwellData::compute_rho_bulk(
const uint aIndex )
3084 return mMaterial->rho( this->compute_T( aIndex ) );
3088 calculator::MaxwellData::compute_drhodT_bulk(
const uint aIndex )
3090 return mMaterial->drhodT( this->compute_T( aIndex ) );
3116 calculator::MaxwellData::compute_rho_metal(
const uint aIndex )
3124 mBeta = mMaxwellCalculator->bj_angle( b, j, mNormB, mNormJ );
3131 return mMaterial->rho( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3139 calculator::MaxwellData::compute_drhodT_powerlaw_ts(
const uint aIndex )
3147 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3153 return mMaterial->drho_powerlaw_dT(
3154 this->norm_j( aIndex ),
3155 this->compute_T( aIndex ),
3156 this->norm_b( aIndex ),
3161 calculator::MaxwellData::compute_drhodT_powerlaw_ts_defect(
const uint aIndex )
3165 const Vector< real > & b = this->compute_b( aIndex );
3169 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3175 this->compute_x( aIndex );
3177 return mMaterial->drho_powerlaw_dT(
3178 this->norm_j( aIndex ),
3179 this->compute_T( aIndex ),
3180 this->norm_b( aIndex ),
3182 mX, mY, mZ, mTime );
3186 calculator::MaxwellData::compute_drhodT_piecewise_ts(
const uint aIndex )
3190 const Vector< real > & b = this->compute_b( aIndex );
3194 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3200 return mMaterial->drho_piecewise_dT(
3201 this->norm_j( aIndex ),
3202 this->compute_T( aIndex ),
3203 this->norm_b( aIndex ),
3208 calculator::MaxwellData::compute_drhodT_piecewise_ts_defect(
const uint aIndex )
3212 const Vector< real > & b = this->compute_b( aIndex );
3216 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3222 this->compute_x( aIndex );
3224 return mMaterial->drho_piecewise_dT(
3225 this->norm_j( aIndex ),
3226 this->compute_T( aIndex ),
3227 this->norm_b( aIndex ),
3229 mX, mY, mZ, mTime );
3233 calculator::MaxwellData::compute_drhodT_powerlaw_bulk(
const uint aIndex )
3235 return mMaterial->drho_powerlaw_dT(
3236 this->norm_j( aIndex ),
3237 this->compute_T( aIndex ),
3238 this->norm_b( aIndex ),
3239 this->beta_dummy() );
3243 calculator::MaxwellData::compute_drhodT_powerlaw_bulk_defect(
const uint aIndex )
3245 this->compute_x( aIndex );
3247 return mMaterial->drho_powerlaw_dT(
3248 this->norm_j( aIndex ),
3249 this->compute_T( aIndex ),
3250 this->norm_b( aIndex ),
3252 mX, mY, mZ, mTime );
3256 calculator::MaxwellData::compute_drhodT_piecewise_bulk(
const uint aIndex )
3258 return mMaterial->drho_piecewise_dT(
3259 this->norm_j( aIndex ),
3260 this->compute_T( aIndex ),
3261 this->norm_b( aIndex ),
3262 this->beta_dummy() );
3266 calculator::MaxwellData::compute_drhodT_piecewise_bulk_defect(
const uint aIndex )
3268 this->compute_x( aIndex );
3270 return mMaterial->drho_piecewise_dT(
3271 this->norm_j( aIndex ),
3272 this->compute_T( aIndex ),
3273 this->norm_b( aIndex ),
3275 mX, mY, mZ, mTime );
3283 calculator::MaxwellData::compute_rho_riva_ts(
const uint aIndex )
3287 const Vector< real > & b = this->compute_b( aIndex );
3291 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3297 return mMaterial->rho_riva(
3298 this->norm_j( aIndex ),
3299 this->compute_T( aIndex ),
3300 this->norm_b( aIndex ),
3305 calculator::MaxwellData::compute_rho_riva_ts_defect(
const uint aIndex )
3309 const Vector< real > & b = this->compute_b( aIndex );
3313 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3319 this->compute_x( aIndex );
3321 return mMaterial->rho_riva(
3322 this->norm_j( aIndex ),
3323 this->compute_T( aIndex ),
3324 this->norm_b( aIndex ),
3326 mX, mY, mZ, mTime );
3330 calculator::MaxwellData::compute_rho_riva_bulk(
const uint aIndex )
3332 return mMaterial->rho_riva(
3333 this->norm_j( aIndex ),
3334 this->compute_T( aIndex ),
3335 this->norm_b( aIndex ),
3336 this->beta_dummy() );
3340 calculator::MaxwellData::compute_rho_riva_bulk_defect(
const uint aIndex )
3342 this->compute_x( aIndex );
3344 return mMaterial->rho_riva(
3345 this->norm_j( aIndex ),
3346 this->compute_T( aIndex ),
3347 this->norm_b( aIndex ),
3349 mX, mY, mZ, mTime );
3353 calculator::MaxwellData::compute_drhodj_riva_ts(
const uint aIndex )
3357 const Vector< real > & b = this->compute_b( aIndex );
3361 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3367 return mMaterial->drho_riva_dJ(
3368 this->norm_j( aIndex ),
3369 this->compute_T( aIndex ),
3370 this->norm_b( aIndex ),
3375 calculator::MaxwellData::compute_drhodj_riva_ts_defect(
const uint aIndex )
3379 const Vector< real > & b = this->compute_b( aIndex );
3383 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3389 this->compute_x( aIndex );
3391 return mMaterial->drho_riva_dJ(
3392 this->norm_j( aIndex ),
3393 this->compute_T( aIndex ),
3394 this->norm_b( aIndex ),
3396 mX, mY, mZ, mTime );
3400 calculator::MaxwellData::compute_drhodj_riva_bulk(
const uint aIndex )
3402 return mMaterial->drho_riva_dJ(
3403 this->norm_j( aIndex ),
3404 this->compute_T( aIndex ),
3405 this->norm_b( aIndex ),
3406 this->beta_dummy() );
3410 calculator::MaxwellData::compute_drhodj_riva_bulk_defect(
const uint aIndex )
3412 this->compute_x( aIndex );
3414 return mMaterial->drho_riva_dJ(
3415 this->norm_j( aIndex ),
3416 this->compute_T( aIndex ),
3417 this->norm_b( aIndex ),
3419 mX, mY, mZ, mTime );
3423 calculator::MaxwellData::compute_drhodb_riva_ts(
const uint aIndex )
3427 const Vector< real > & b = this->compute_b( aIndex );
3431 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3437 return mMaterial->drho_riva_dB(
3438 this->norm_j( aIndex ),
3439 this->compute_T( aIndex ),
3440 this->norm_b( aIndex ),
3445 calculator::MaxwellData::compute_drhodb_riva_ts_defect(
const uint aIndex )
3449 const Vector< real > & b = this->compute_b( aIndex );
3453 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3459 this->compute_x( aIndex );
3461 return mMaterial->drho_riva_dB(
3462 this->norm_j( aIndex ),
3463 this->compute_T( aIndex ),
3464 this->norm_b( aIndex ),
3466 mX, mY, mZ, mTime );
3470 calculator::MaxwellData::compute_drhodb_riva_bulk(
const uint aIndex )
3472 return mMaterial->drho_riva_dB(
3473 this->norm_j( aIndex ),
3474 this->compute_T( aIndex ),
3475 this->norm_b( aIndex ),
3476 this->beta_dummy() );
3480 calculator::MaxwellData::compute_drhodb_riva_bulk_defect(
const uint aIndex )
3482 this->compute_x( aIndex );
3484 return mMaterial->drho_riva_dB(
3485 this->norm_j( aIndex ),
3486 this->compute_T( aIndex ),
3487 this->norm_b( aIndex ),
3489 mX, mY, mZ, mTime );
3493 calculator::MaxwellData::compute_drhodT_riva_ts(
const uint aIndex )
3497 const Vector< real > & b = this->compute_b( aIndex );
3501 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3507 return mMaterial->drho_riva_dT(
3508 this->norm_j( aIndex ),
3509 this->compute_T( aIndex ),
3510 this->norm_b( aIndex ),
3515 calculator::MaxwellData::compute_drhodT_riva_ts_defect(
const uint aIndex )
3519 const Vector< real > & b = this->compute_b( aIndex );
3523 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3529 this->compute_x( aIndex );
3531 return mMaterial->drho_riva_dT(
3532 this->norm_j( aIndex ),
3533 this->compute_T( aIndex ),
3534 this->norm_b( aIndex ),
3536 mX, mY, mZ, mTime );
3540 calculator::MaxwellData::compute_drhodT_riva_bulk(
const uint aIndex )
3542 return mMaterial->drho_riva_dT(
3543 this->norm_j( aIndex ),
3544 this->compute_T( aIndex ),
3545 this->norm_b( aIndex ),
3546 this->beta_dummy() );
3550 calculator::MaxwellData::compute_drhodT_riva_bulk_defect(
const uint aIndex )
3552 this->compute_x( aIndex );
3554 return mMaterial->drho_riva_dT(
3555 this->norm_j( aIndex ),
3556 this->compute_T( aIndex ),
3557 this->norm_b( aIndex ),
3559 mX, mY, mZ, mTime );
3563 calculator::MaxwellData::compute_drhodT_metal(
const uint aIndex )
3567 const Vector< real > & b = this->compute_b( aIndex );
3568 const Vector< real > &
j = this->compute_j( aIndex );
3571 mBeta = mMaxwellCalculator->bj_angle( b,
j, mNormB, mNormJ );
3578 return mMaterial->drhodT( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3590 mdRhodB = mRhoClamped ? 0.0 : ( this->*mFundRhodB )( aIndex );
3605 mdRhodBeta = mRhoClamped ? 0.0 : ( this->*mFundRhodBeta )( aIndex );
3612 calculator::MaxwellData::compute_drhodb_metal(
const uint aIndex )
3620 mBeta = mMaxwellCalculator->bj_angle( b, j, mNormB, mNormJ );
3627 return mMaterial->drhodB( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3631 calculator::MaxwellData::compute_drhodbeta_metal(
const uint aIndex )
3639 mBeta = mMaxwellCalculator->bj_angle( b, j, mNormB, mNormJ );
3646 return mMaterial->drhodbeta( this->compute_T( aIndex ), this->norm_b( aIndex ), mBeta );
3656 calculator::MaxwellData::compute_drhodb_powerlaw_ts(
const uint aIndex )
3660 const Vector< real > & b = this->compute_b( aIndex );
3664 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3670 return mMaterial->drho_powerlaw_dB(
3671 this->norm_j( aIndex ),
3672 this->compute_T( aIndex ),
3673 this->norm_b( aIndex ),
3678 calculator::MaxwellData::compute_drhodb_powerlaw_ts_defect(
const uint aIndex )
3682 const Vector< real > & b = this->compute_b( aIndex );
3686 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3692 this->compute_x( aIndex );
3694 return mMaterial->drho_powerlaw_dB(
3695 this->norm_j( aIndex ),
3696 this->compute_T( aIndex ),
3697 this->norm_b( aIndex ),
3699 mX, mY, mZ, mTime );
3703 calculator::MaxwellData::compute_drhodb_piecewise_ts(
const uint aIndex )
3707 const Vector< real > & b = this->compute_b( aIndex );
3711 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3717 return mMaterial->drho_piecewise_dB(
3718 this->norm_j( aIndex ),
3719 this->compute_T( aIndex ),
3720 this->norm_b( aIndex ),
3725 calculator::MaxwellData::compute_drhodb_piecewise_ts_defect(
const uint aIndex )
3729 const Vector< real > & b = this->compute_b( aIndex );
3733 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3739 this->compute_x( aIndex );
3741 return mMaterial->drho_piecewise_dB(
3742 this->norm_j( aIndex ),
3743 this->compute_T( aIndex ),
3744 this->norm_b( aIndex ),
3746 mX, mY, mZ, mTime );
3750 calculator::MaxwellData::compute_drhodb_powerlaw_bulk(
const uint aIndex )
3752 return mMaterial->drho_powerlaw_dB(
3753 this->norm_j( aIndex ),
3754 this->compute_T( aIndex ),
3755 this->norm_b( aIndex ),
3756 this->beta_dummy() );
3760 calculator::MaxwellData::compute_drhodb_powerlaw_bulk_defect(
const uint aIndex )
3762 this->compute_x( aIndex );
3764 return mMaterial->drho_powerlaw_dB(
3765 this->norm_j( aIndex ),
3766 this->compute_T( aIndex ),
3767 this->norm_b( aIndex ),
3769 mX, mY, mZ, mTime );
3773 calculator::MaxwellData::compute_drhodb_piecewise_bulk(
const uint aIndex )
3775 return mMaterial->drho_piecewise_dB(
3776 this->norm_j( aIndex ),
3777 this->compute_T( aIndex ),
3778 this->norm_b( aIndex ),
3779 this->beta_dummy() );
3783 calculator::MaxwellData::compute_drhodb_piecewise_bulk_defect(
const uint aIndex )
3785 this->compute_x( aIndex );
3787 return mMaterial->drho_piecewise_dB(
3788 this->norm_j( aIndex ),
3789 this->compute_T( aIndex ),
3790 this->norm_b( aIndex ),
3792 mX, mY, mZ, mTime );
3796 calculator::MaxwellData::compute_rho_powerlaw_bulk(
const uint aIndex )
3798 return mMaterial->rho_powerlaw(
3799 this->norm_j( aIndex ),
3800 this->compute_T( aIndex ),
3801 this->norm_b( aIndex ),
3802 this->beta_dummy() );
3806 calculator::MaxwellData::compute_rho_piecewise_bulk(
const uint aIndex )
3808 return mMaterial->rho_piecewise(
3809 this->norm_j( aIndex ),
3810 this->compute_T( aIndex ),
3811 this->norm_b( aIndex ),
3812 this->beta_dummy() );
3816 calculator::MaxwellData::compute_drhodj_powerlaw_bulk(
const uint aIndex )
3818 return mMaterial->drho_powerlaw_dJ(
3819 this->norm_j( aIndex ),
3820 this->compute_T( aIndex ),
3821 this->norm_b( aIndex ),
3822 this->beta_dummy() );
3826 calculator::MaxwellData::compute_drhodj_piecewise_bulk(
const uint aIndex )
3828 return mMaterial->drho_piecewise_dJ(
3829 this->norm_j( aIndex ),
3830 this->compute_T( aIndex ),
3831 this->norm_b( aIndex ),
3832 this->beta_dummy() );
3836 calculator::MaxwellData::compute_rho_powerlaw_ts(
const uint aIndex )
3841 const Vector< real > & b = this->compute_b( aIndex );
3845 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3851 return mMaterial->rho_powerlaw(
3852 this->norm_j( aIndex ),
3853 this->compute_T( aIndex ),
3854 this->norm_b( aIndex ),
3859 calculator::MaxwellData::compute_drhodj_powerlaw_ts(
const uint aIndex )
3864 const Vector< real > & b = this->compute_b( aIndex );
3868 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3874 return mMaterial->drho_powerlaw_dJ(
3875 this->norm_j( aIndex ),
3876 this->compute_T( aIndex ),
3877 this->norm_b( aIndex ),
3882 calculator::MaxwellData::compute_rho_piecewise_ts(
const uint aIndex )
3887 const Vector< real > & b = this->compute_b( aIndex );
3891 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3897 return mMaterial->rho_piecewise(
3898 this->norm_j( aIndex ),
3899 this->compute_T( aIndex ),
3900 this->norm_b( aIndex ),
3905 calculator::MaxwellData::compute_drhodj_piecewise_ts(
const uint aIndex )
3910 const Vector< real > & b = this->compute_b( aIndex );
3914 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3920 return mMaterial->drho_piecewise_dJ(
3921 this->norm_j( aIndex ),
3922 this->compute_T( aIndex ),
3923 this->norm_b( aIndex ),
3928 calculator::MaxwellData::compute_rho_powerlaw_bulk_defect(
const uint aIndex )
3930 this->compute_x( aIndex );
3932 return mMaterial->rho_powerlaw(
3933 this->norm_j( aIndex ),
3934 this->compute_T( aIndex ),
3935 this->norm_b( aIndex ),
3937 mX, mY, mZ, mTime );
3941 calculator::MaxwellData::compute_drhodj_powerlaw_bulk_defect(
const uint aIndex )
3943 this->compute_x( aIndex );
3945 return mMaterial->drho_powerlaw_dJ(
3946 this->norm_j( aIndex ),
3947 this->compute_T( aIndex ),
3948 this->norm_b( aIndex ),
3950 mX, mY, mZ, mTime );
3954 calculator::MaxwellData::compute_rho_powerlaw_ts_defect(
const uint aIndex )
3959 const Vector< real > & b = this->compute_b( aIndex );
3963 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3969 this->compute_x( aIndex );
3971 return mMaterial->rho_powerlaw(
3972 this->norm_j( aIndex ),
3973 this->compute_T( aIndex ),
3974 this->norm_b( aIndex ),
3976 mX, mY, mZ, mTime );
3980 calculator::MaxwellData::compute_drhodj_powerlaw_ts_defect(
const uint aIndex )
3985 const Vector< real > & b = this->compute_b( aIndex );
3989 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
3995 this->compute_x( aIndex );
3997 return mMaterial->drho_powerlaw_dJ(
3998 this->norm_j( aIndex ),
3999 this->compute_T( aIndex ),
4000 this->norm_b( aIndex ),
4002 mX, mY, mZ, mTime );
4006 calculator::MaxwellData::compute_rho_piecewise_bulk_defect(
const uint aIndex )
4008 this->compute_x( aIndex );
4009 return mMaterial->rho_piecewise(
4010 this->norm_j( aIndex ),
4011 this->compute_T( aIndex ),
4012 this->norm_b( aIndex ),
4014 mX, mY, mZ, mTime );
4018 calculator::MaxwellData::compute_drhodj_piecewise_bulk_defect(
const uint aIndex )
4020 this->compute_x( aIndex );
4021 return mMaterial->drho_piecewise_dJ(
4022 this->norm_j( aIndex ),
4023 this->compute_T( aIndex ),
4024 this->norm_b( aIndex ),
4026 mX, mY, mZ, mTime );
4030 calculator::MaxwellData::compute_rho_piecewise_ts_defect(
const uint aIndex )
4035 const Vector< real > & b = this->compute_b( aIndex );
4039 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
4045 this->compute_x( aIndex );
4047 return mMaterial->rho_piecewise(
4048 this->norm_j( aIndex ),
4049 this->compute_T( aIndex ),
4050 this->norm_b( aIndex ),
4057 calculator::MaxwellData::compute_drhodj_piecewise_ts_defect(
const uint aIndex )
4062 const Vector< real > & b = this->compute_b( aIndex );
4066 mBeta = mMaxwellCalculator->bn_angle( b, mN, mNormB );
4072 this->compute_x( aIndex );
4074 return mMaterial->drho_piecewise_dJ(
4075 this->norm_j( aIndex ),
4076 this->compute_T( aIndex ),
4077 this->norm_b( aIndex ),
4079 mX, mY, mZ, mTime );
4088 return ( this->*mFundMudH ) ( aIndex );
4095 calculator::MaxwellData::compute_dmu_zero(
const uint aIndex )
4102 calculator::MaxwellData::compute_dmu_material(
const uint aIndex )
4106 mNormH =
norm( this->compute_h( aIndex ) );
4109 mMaterial->dmudH( mNormH, mMu, mdMudH );
4117 return ( this->*mFunHeat )( aIndex );
4121 calculator::MaxwellData::compute_heatload_user(
const uint aIndex )
4123 this->compute_x( aIndex );
4125 return mMaterial->volumetric_heatload( mX, mY, mZ, mTime );
4129 calculator::MaxwellData::return_zero(
const uint aIndex )
4135 calculator::MaxwellData::beta_dummy()
const
4143 "bulk-HTS dummy beta was polluted ( expected pi/2 )" );
4151 "material %s provides neither density nor ref_density",
4152 mMaterial->label().c_str() );
4165 return mRhoClamped ;
4171 return mMaxwellCalculator ;
4177 return mThermalCalculator ;
4183 BELFEM_ASSERT( mMaxwellData !=
nullptr,
"MaxwellData has not been initialized" );
4184 return mMaxwellData ;
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
A bounds-checked wrapper around std::vector.
Definition cl_Cell.hpp:45
Hash map (unordered key-value).
Definition cl_Map.hpp:75
Base class for all materials in BELFEM.
Definition cl_Material.hpp:270
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:204
Definition cl_FEM_Calculator.hpp:596
Matrix< real > & M()
return the mass matrix
Definition cl_FEM_Calculator.hpp:2363
const IntegrationData * master_integration() const
Definition cl_FEM_Calculator.hpp:2315
const Vector< real > & nedelec_data_slave_h()
slave twin of nedelec_data_master_h(), into vector( "nedelec_h_s" )
Definition cl_FEM_Calculator.cpp:2114
const IntegrationData * slave_integration() const
Definition cl_FEM_Calculator.hpp:2323
const Matrix< real > & Cs(const uint aIndex)
curl interpolator on slave
Definition cl_FEM_Calculator.cpp:2977
real timestep() const
Definition cl_FEM_Calculator.hpp:2395
const Matrix< real > & G(const uint aIndex)
gradient interpolator for nedelec elements
Definition cl_FEM_Calculator.cpp:2913
void link(Group *aGroup)
Definition cl_FEM_Calculator.cpp:1705
const Matrix< real > & Cm(const uint aIndex)
curl interpolator on master
Definition cl_FEM_Calculator.cpp:2955
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:1977
void initialize_integration(const ElementType aElementType, const InterpolationType aInterpolationType)
Definition cl_FEM_Calculator.cpp:882
void print_dofs()
Definition cl_FEM_Calculator.cpp:2045
uint integration_order() const
Definition cl_FEM_Calculator.hpp:2499
real dS(const uint aIndex=0)
surface increment
Definition cl_FEM_Calculator.hpp:2079
const Matrix< real > & Es(const uint aIndex)
edge interpolator on slave
Definition cl_FEM_Calculator.cpp:2966
real node_interp(const uint aIndex, const Vector< real > &aNodeValues) const
node interpolation function for local values
Definition cl_FEM_Calculator.hpp:2048
void allocate_memory()
Definition cl_FEM_Calculator.cpp:942
Matrix< real > & K()
return the stiffness matrix
Definition cl_FEM_Calculator.hpp:2355
Matrix< real > & matrix(const string &aLabel)
return a matrix object
Definition cl_FEM_Calculator.hpp:1687
const Vector< real > & Nvec(const uint aIndex) const
node interpolator, but as vector
Definition cl_FEM_Calculator.hpp:2055
const Matrix< real > & Xm() const
node coordinates on master element
Definition cl_FEM_Calculator.hpp:1703
const Matrix< real > & invJ(const uint aIndex)
inverse of jacobian matrix
Definition cl_FEM_Calculator.hpp:1765
void allocate()
called by dof manager
Definition cl_FEM_Calculator.cpp:1185
void link_maxwell(Kernel *aMaxwellKernel, Kernel *aThermalKernel=nullptr)
register the kernels for the maxwell data helper.
Definition cl_FEM_Calculator.cpp:1672
const Matrix< real > & Nm(const uint aIndex)
node interpolator master
Definition cl_FEM_Calculator.hpp:2016
const Matrix< real > & Em(const uint aIndex)
edge interpolator on master
Definition cl_FEM_Calculator.cpp:2944
bool element_is_linear() const
Definition cl_FEM_Calculator.hpp:2513
const IntegrationData * integration() const
Definition cl_FEM_Calculator.hpp:2307
bool matrix_exists(const string aLabel) const
Definition cl_FEM_Calculator.hpp:1679
const Material * material() const
Definition cl_FEM_Calculator.cpp:2988
void set_integration_order(const uint aOrder)
rebuilds the group's lookup tables at aOrder, then lets allocate_memory() replace the edge functions ...
Definition cl_FEM_Calculator.cpp:905
calculator::MatrixData * create_matrix(const string &aLabel, const uint aNumRows, const uint aNumCols)
Definition cl_FEM_Calculator.cpp:2014
const Matrix< real > & Ns(const uint aIndex)
node interpolator slave
Definition cl_FEM_Calculator.hpp:2024
Vector< real > & qswap()
return a swap vector for the dofs
Definition cl_FEM_Calculator.cpp:2868
void init_qold_table()
Definition cl_FEM_Calculator.cpp:2806
const Vector< real > & normal(const uint aIndex=0)
returns the normal of a surface
Definition cl_FEM_Calculator.hpp:2071
Group * group()
Definition cl_FEM_Calculator.hpp:2426
uint num_intpoints() const
Definition cl_FEM_Calculator.hpp:2387
void set_model_parameters(const Vector< real > &aParams)
Definition cl_FEM_Calculator.hpp:2402
real bn_angle(const Vector< real > &b, const Vector< real > &n, real &norm_b) const
Definition cl_FEM_Calculator.hpp:2525
const IntegrationData * volume_integration() const
Definition cl_FEM_Calculator.hpp:2331
const Matrix< real > & B(const uint aIndex=0)
gradient operator
Definition cl_FEM_Calculator.hpp:2063
const Matrix< real > & C(const uint aIndex)
curl interpolator
Definition cl_FEM_Calculator.cpp:2901
const Matrix< real > & E(const uint aIndex)
edge interpolator
Definition cl_FEM_Calculator.cpp:2889
Matrix< real > & JN()
return the Newton correction matrix
Definition cl_FEM_Calculator.hpp:2371
const Matrix< real > & Xs() const
node coordinates on slave element
Definition cl_FEM_Calculator.hpp:1711
const Matrix< real > & Jm(const uint aIndex)
jacobian matrix for master
Definition cl_FEM_Calculator.hpp:1735
Element * element()
Definition cl_FEM_Calculator.hpp:2418
void print_local_dofs()
Definition cl_FEM_Calculator.cpp:2053
const Vector< real > & node_data(const string &aNodeField)
return a vector object
Definition cl_FEM_Calculator.cpp:2768
const IntegrationData * volume_enrichment() const
Definition cl_FEM_Calculator.hpp:2339
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:2084
real bj_angle(const Vector< real > &b, const Vector< real > &j, real &norm_b, real &norm_j) const
Definition cl_FEM_Calculator.hpp:2519
bool vector_exists(const string aLabel) const
Definition cl_FEM_Calculator.hpp:1664
uint num_nedelec_dofs() const
Definition cl_FEM_Calculator.cpp:2925
Vector< real > & vector(const string &aLabel)
return a vector object
Definition cl_FEM_Calculator.hpp:1672
const Matrix< real > & J(const uint aIndex)
jacobian matrix
Definition cl_FEM_Calculator.hpp:1719
const Vector< real > & qold(const uint aStep=0)
return the dof vector at an old timestep
Definition cl_FEM_Calculator.cpp:2778
const Vector< real > & nedelec_data_h()
Definition cl_FEM_Calculator.hpp:2434
const Matrix< real > & X() const
node coordinates on element
Definition cl_FEM_Calculator.hpp:1695
const Vector< real > & nedelec_data_a()
Definition cl_FEM_Calculator.hpp:2442
EdgeFunction * edge_function()
Definition cl_FEM_Calculator.hpp:1346
Mesh * mesh()
Definition cl_FEM_Calculator.hpp:2506
const Matrix< real > & Bs(const uint aIndex=0)
gradient operator slave
Definition cl_FEM_Calculator.hpp:2040
Calculator(Group *aGroup, const ModelDimensionality aDimensionality)
default constructor
Definition cl_FEM_Calculator.cpp:817
const Matrix< real > & Bm(const uint aIndex=0)
gradient operator master
Definition cl_FEM_Calculator.hpp:2032
Vector< real > & f()
return the load vector
Definition cl_FEM_Calculator.hpp:2379
real dV(const uint aIndex=0)
volume increment
Definition cl_FEM_Calculator.hpp:2093
const IntegrationData * sideset_enrichment() const
Definition cl_FEM_Calculator.hpp:2347
const Matrix< real > & Js(const uint aIndex)
jacobian matrix for slave
Definition cl_FEM_Calculator.hpp:1750
calculator::MaxwellData * maxwell()
Definition cl_FEM_Calculator.hpp:4181
const Vector< real > & model_parameters() const
Definition cl_FEM_Calculator.hpp:2410
calculator::VectorData * create_vector(const string &aLabel, const uint aSize, const EntityType aType=EntityType::UNDEFINED)
Returns calculator-owned workspace.
Definition cl_FEM_Calculator.cpp:1985
const Vector< real > & q()
return the dof vector at current timestep
Definition cl_FEM_Calculator.cpp:2876
const Matrix< real > & N(const uint aIndex)
node interpolator
Definition cl_FEM_Calculator.hpp:2008
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:1913
the edge function base class
Definition cl_EF_EdgeFunction.hpp:39
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:35
const Vector< real > & weights() const
return the integration weights
Definition cl_IF_IntegrationData.hpp:273
Top-level orchestrator.
Definition cl_FEM_Kernel.hpp:56
Definition cl_FEM_Calculator.hpp:79
void set_index(const uint aIndex)
Definition cl_FEM_Calculator.hpp:1643
const string & label() const
Definition cl_FEM_Calculator.hpp:1637
uint index() const
Definition cl_FEM_Calculator.hpp:1649
Matrix< real > & matrix()
Definition cl_FEM_Calculator.hpp:1657
MatrixData(const string &aLabel, const uint aNumRows, const uint aNumCols)
Definition cl_FEM_Calculator.cpp:55
Definition cl_FEM_Calculator.hpp:132
real compute_lambda(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2945
real compute_cp(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2920
real compute_dlambdadT(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2956
real compute_drhodbeta(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3597
const Vector< real > & compute_h(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2779
const Vector< real > & compute_b(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2825
bool T_clamped() const
Definition cl_FEM_Calculator.hpp:4157
Calculator * maxwell()
Definition cl_FEM_Calculator.hpp:4169
real density() const
Definition cl_FEM_Calculator.hpp:4148
void reset()
Definition cl_FEM_Calculator.hpp:2757
real compute_drhodj(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2873
real compute_T(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2914
real compute_drhodb(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3582
real compute_dmudh(const uint aIndex)
Definition cl_FEM_Calculator.hpp:4083
real norm_b(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3094
const Vector< real > & compute_j(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2613
void compute_x(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2586
real compute_rho(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2854
real compute_dcpdT(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2931
bool rho_clamped() const
Definition cl_FEM_Calculator.hpp:4163
real compute_drhodT(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2888
Calculator * thermal()
Definition cl_FEM_Calculator.hpp:4175
real norm_j(const uint aIndex)
Definition cl_FEM_Calculator.hpp:3105
real compute_mu(const uint aIndex)
Definition cl_FEM_Calculator.hpp:2791
MaxwellData(Calculator *aCalculator, Kernel *aMaxwellKernel, Kernel *aThermalKernel)
Definition cl_FEM_Calculator.cpp:65
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:4115
Definition cl_FEM_Calculator.hpp:49
const string & label() const
Definition cl_FEM_Calculator.hpp:1607
Vector< real > & vector()
Definition cl_FEM_Calculator.hpp:1625
EntityType entity_type() const
Definition cl_FEM_Calculator.hpp:1631
VectorData(const string &aLabel, const uint aSize, const EntityType aType)
Definition cl_FEM_Calculator.cpp:44
void set_index(const uint aIndex)
Definition cl_FEM_Calculator.hpp:1613
uint index() const
Definition cl_FEM_Calculator.hpp:1619
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:41
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:2700
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:2656
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
Definition globals.hpp:51
ElementType
Element types.
Definition Mesh_Enums.hpp:27
constexpr real gTmin
Definition typedefs.hpp:64
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
maximum resistivity in Ohm*m, default: 1e10
Definition globals.hpp:54
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_UINT_MAX
Definition typedefs.hpp:79
#define BELFEM_REAL_MAX
Definition typedefs.hpp:80
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:86