BasicTools.FE.Integration module

BasicTools.FE.Integration.CheckIntegrity(GUI=False)[source]
BasicTools.FE.Integration.CheckIntegrityComputeVolume(mesh)[source]
BasicTools.FE.Integration.CheckIntegrityConstantRectilinearIntegration(GUI=False)[source]
BasicTools.FE.Integration.CheckIntegrityConstantRectilinearIntegrationII(GUI=False)[source]
BasicTools.FE.Integration.CheckIntegrityIntegrationWithIntegrationPointField(GUI=False)[source]
BasicTools.FE.Integration.CheckIntegrityKF(edim, sdim, testCase)[source]
BasicTools.FE.Integration.CheckIntegrityNormalFlux(GUI=False)[source]
BasicTools.FE.Integration.IntegrateGeneral(mesh, wform, constants, fields, unkownFields=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

BasicTools.FE.Integration.IntegrateGeneralMonoThread(mesh, wform, constants, fields, unkownFields=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 BasicTools.FE.Integration.IntegrationClass(other=None)[source]

Bases: BaseOutputObject

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()
PreStartCheck()[source]

verification of the integration rule for the ip fields:

Reset()[source]
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

SetExtraFields(fields)[source]

Set the extra fields used in the weak formulation

Parameters:

efs (list(FEField or IPField) list of fields) –

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 )

SetIntegrator(userIntegrator=None)[source]

Set the internal integrator (only for advance users)

SetMesh(mesh)[source]

Set the mesh defining the integration domain :param mesh: mesh containing the geometry :type mesh: UnstructuredMesh

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)

SetUnkownFields(unkownFields)[source]

Set the fields used for the unknown space

Parameters:

unkownFields (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()