Toggle Light / Dark / Auto color theme
Toggle table of contents sidebar
Source code for Muscat.FE.Spaces.BarSpaces
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
#
import numpy as np
from sympy.matrices import Matrix
import Muscat.Containers.ElementsDescription as ED
from Muscat.FE.Spaces.SymSpace import SymSpaceBase
[docs] class BarSpaceBase ( SymSpaceBase ):
def __init__ ( self ):
super () . __init__ ()
self . dimensionality = 1
self . geoSupport = ED . GeoSupport . GeoBar
[docs] class Bar_P0_Global ( BarSpaceBase ):
def __init__ ( self ):
super () . __init__ ()
self . symN = Matrix ([ 1 ])
self . posN = np . array ([[ None ]])
self . dofAttachments = [( "G" , None , None )]
[docs] class Bar_P0_Lagrange ( BarSpaceBase ):
def __init__ ( self ):
super () . __init__ ()
self . symN = Matrix ([ 1 ])
self . posN = np . array ([[ 0.5 ]])
self . dofAttachments = [( "C" , 0 , None ) ]
[docs] class Bar_P1_Lagrange ( BarSpaceBase ):
def __init__ ( self ):
super () . __init__ ()
xi = self . xi
self . symN = Matrix ([( 1 - xi ), xi ])
self . posN = np . array ([[ 0 ],
[ 1 ]])
self . dofAttachments = [( "P" , 0 , None ),
( "P" , 1 , None )]
[docs] class Bar_P2_Lagrange ( BarSpaceBase ):
def __init__ ( self ):
super () . __init__ ()
xi = self . xi
L1 = 1 - xi
L2 = xi
self . symN = Matrix ([ L1 * ( 2 * L1 - 1 ), L2 * ( 2 * L2 - 1 ), 4 * L1 * L2 ])
self . posN = np . array ([[ 0 ],
[ 1 ],
[ 0.5 ],])
self . dofAttachments = [( "P" , 0 , None ),
( "P" , 1 , None ),
( "C" , 0 , None ),]
[docs] def CheckIntegrity ( GUI : bool = False ):
return "ok"
if __name__ == '__main__' :
print ( CheckIntegrity ( True )) #pragma: no cover