Muscat.FE.Integrators.PythonIntegration module

CheckIntegrity(GUI: bool = False)[source]
class MonoElementsIntegral[source]

Bases: object

Class to assembly a formulation (weak form) into a matrix or a vector

  • unknownDofsOffset : offset for the unknown dofs

  • __ufs__ : unknown fields

  • testDofsOffset : offset for the test dofs

  • __tfs__ : unknown dofs

  • totalTestDofs : Total number fo test dofs (computed Automatically)

  • totalUnknownDofs : Total number fo unknown dofs (computed Automatically)

  • geoSpace : Geometry approximation space (computed Automatically)

  • __efs__ : Extra Fields

  • __cfs__ : (dic(str:float) ) Constants

  • integrationRule : integration rule for the integration

  • onlyEvaluation : To force the integrator to not multiply by the detJac

  • numberOfVIJ = 0

  • F : rhs vector

  • vK, iK, jKVectors containing the values and indices for the entries

    of the operator

  • totalvijcpt : Number of non zero entries in the self.vK iK ant jK vector

  • maxNumberOfTerms : maximal number of terms in a monom (computed Automatically)

  • hasnormal : (computed Automatically)

  • __usedSpaces__

  • geoSpaceNumber

ActivateElementType(domain)[source]

Function to prepared the integration for a type of element domain : (ElementsContainer)

AddToNumbefOfUsedIvij(data)[source]

add a value to the UsedIvij

ComputeNumberOfVIJ(mesh, elementFilter)[source]

Compute and return the number triplets to be calculated during integration

GetNumberOfUsedIvij()[source]

Return number of non zero values in the vectors vK,iK,jK

GetTotalTestDofs()[source]

Return the number of dofs of the test space (number of rows of the K matrix)

GetTotalUnknownDofs()[source]

Return the number of dofs of the Unknown space (number of cols of the K matrix)

Integrate(wform, idstotreat)[source]

Main function to execute the integration wform: (PyWeakForm) Python Or C++ version of the weak form to be integrated idstotreat: list like (int) ids of the element to treat

IsFrozen()
IsMultiThread()[source]

In pure python the GIL block so a multiThread is useless

PrepareFastIntegration(mesh, wform, vK, iK, jK, cpt, F)[source]
Function to prepare the integration procedure, this function checks:
  • if the weak form needs the normal at each integration point

  • prepare the fields to be used

  • fills each term in the weak formulation with the data about the

    fields for fast access

mesh : a mesh wform: the weak form to be integrated vK,iK,jK = the vectors to store the calculated values for the K op cpt

Reset()[source]
SetConstants(cfs)[source]

Set The constants used in the weak formulation

cfs : dic(str:float) constants dictionary

SetExtraFields(efs)[source]

Set the extra fields used in the weak formulation

efs : list(FEField or IPField) list of fields

SetIntegrationRule(integrationRuleOrName: Dict | str | None = None)[source]

Function to set the integration Rule

SetOnlyEvaluation(onlyEvaluation=True)[source]
To activate the Only Evaluation functionality

For the evaluation we only add the constribution without doing the integration (multiplication by the detjac ) the user is responsible of dividing by the mass matrix to get the correct values . Ffr example the user can use a discontinues field to generate element surface stress

SetPoints(nodes)[source]

## from https://github.com/cython/cython/wiki/tutorials-NumpyPointerToC

multiply (arr, value)

Takes a numpy arry as input, and multiplies each elemetn by value, in place

param: array – a 2-d numpy array of np.float64

SetTestFields(tfs=None)[source]

Set the fields used for the test space

tfs : list(FEField) list of fields if tfs is none then the unknown fields are used (Galerkin projection)

SetUnknownFields(ufs)[source]

Set the fields used for the unknown space

ufs : list(FEField) list of fields

UnFrozen()
onlyEvaluation

For the evaluation we only add the contribution without doing the integration the user is responsible of dividing by the mass matrix to get the correct values also the user can use a discontinues field to generate element surface stress (for example)