Muscat.FE.Integration module¶
- IntegrateGeneral(mesh, wform, constants, fields, unknownFields=None, testFields=None, integrationRuleName=None, onlyEvaluation=False, elementFilter=None, userIntegrator=None, integrationRule=None)[source]¶
Integration of a weak formulation
For more information about the argument please refer to IntegrationClass
- Returns:
K (coo_matrix) – the assembled matrix
rhs (ndarray) – Array with the values of the right hand side term
- IntegrateGeneralMonoThread(mesh, wform, constants, fields, unknownFields=None, testFields=None, integrationRuleName=None, onlyEvaluation=False, elementFilter=None, userIntegrator=None, integrationRule=None)[source]¶
Integration of a weak formulation using only one thread
For more information about the argument please refer to IntegrationClass
- Returns:
K (coo_matrix) – the assembled matrix
rhs (ndarray) – Array with the values of the right hand side term
- class IntegrationClass(other=None)[source]¶
Bases:
object
Class to define and execute an integration of a weak form
- Allocate()[source]¶
Function to allocate the memory to do the integration This function must be called right before the integration
- Compute(forceMonoThread=False)[source]¶
Execute the integration in multithread
- Parameters:
forceMonoThread (bool) – true to force the use of only one thread
- ComputeMonoThread(elementFilter=None)[source]¶
Execute the integration using only one tread (this function is no thread safe)
- GetK()[source]¶
Get K as a scipy.sparse.coo_matrix
- Returns:
K – the asembled matrix
- Return type:
coo_matrix
- GetKvij()[source]¶
Get the values to build the operator
- Returns:
values (ndarray) – values of the operator
tuple ((ndarray,ndarray)) – indices (i,j)
- GetLinearSystemSize()[source]¶
Get the size of the Linear System
- Returns:
nbrows (int) – Number of rows of the linear system
nbcols (int) – Number of columns of the linear system
- GetRhs()[source]¶
Get the right hand side term
- Returns:
rhs – Array with the values of the right hand side term
- Return type:
ndarray
- IsFrozen()¶
- SetConstants(constants)[source]¶
Set the contacts to be used in the weak form
- Parameters:
constant (dict) – dictionary with the constants key : string , value: float
- SetElementFilter(elementFilter=None)[source]¶
Set the element filter to select the elements of the integration
- SetIntegrationRule(integrationRuleName=None, integrationRule=None)[source]¶
Set the Integration rule to be used during integration
- Parameters:
integrationRuleName (str, optional) – name of the integrationRule
integrationRule (dict, optional) – integration rule for every element type key->str: value: tuple(intPoints ndarray, intWeights )
- SetMesh(mesh)[source]¶
Set the mesh defining the integration domain :param mesh: mesh containing the geometry :type mesh: Mesh
- SetOnlyEvaluation(onlyEvaluation)[source]¶
Set the onlyEvaluation option. If true the contribution of the determinant of the transformation and the weight of the integration points is ignored. the user is responsible of dividing by the mass matrix (if necessary) to get the correct values.
- Parameters:
onlyEvaluation (bool) – True to activate this option
- SetOutputObjects(vK, iK, jK, rhs)[source]¶
This is an advace feature, the user must put objects of the correct size
- SetTestFields(testFields)[source]¶
Set the fields used for the test space
- Parameters:
tfs (list(FEField) list of fields) – if tfs is none then the unknown fields are used (Galerkin projection)
- SetUnknownFields(unknownFields)[source]¶
Set the fields used for the unknown space
- Parameters:
unknownFields (list(FEField) list of fields) –
- SetWeakForm(weakForm)[source]¶
Set the weak form to be integrated :param weakForm: Weak form to be integrated :type weakForm: NativeNumericalWeakForm or PyWeakForm
- UnFrozen()¶