Preprocessing module
Temporary documentation for the content of IGAparametrization class.
geometricSettings corresponds to the content of .NB file
mechanicalSettings corresponds to the content of .inp file
mechanicalSettings is a list with the following components :
[0] : parameters ???
[1] : boundary conditions
[2] : load
[3] : nodes
[4] : IEN connectivity
[5] : material properties
[6] : properties ???
[7] : tables, used for nodal distributions
[8] : shapeparametrization ????
geometricSettings is a list with the following components :
[0] : dimension
[1] : sizes of knot vectors
[2] : knot vectors
[3] : degrees
[4] : knot spans
[5] : weights
[6] : number of elements per patch
[7] : number of nodes ???
[8] : number of elements (per patch ???)
Members of IGAparametrization class
Global model informations
_ELT_TYPE : an array containing the element types for each patch (size : number of patchs)
_NBPINT : an array containing the number of integration points per element for each patch (size : number of patchs)
_TENSOR : an array containing the tensor type for each patch patch (size : number of patchs)
_mcrd : a scalar the number of coordinates of the model
Control points informations
_COORDS : a 2D array containing the coordinates of the control points (shape : 3, number of control points)
_nb_cp : a scalar containing the total number of control points
Elements informations
_IEN : a list containing the connectivity table for each patch (length : number of patchs). Each element of the list _IEN is a 2D array of shape (number of element of the patch, number of control points per element)
Material informations
_MATERIAL_PROPERTIES : a 2D array containing the material properties for each patch (shape : 3, number of patchs). The first dimension is 3 for elastic materials (Young modulus, Poisson ratio, density) but can be set higher for specific material behaviours (gradient elasticity, plasticity, …)
_N_MATERIAL_PROPERTIES : an array containing the numebr of material properties for each patch (size : number of patchs)
Properties informations
_PROPS : a list containing arrays with the properties with real values for each patch (length : number of patchs). Each element of the _PROPS list can have a different size
_JPROPS : an array containing the number of properties for each patch (size : number of patchs)
Geometry informations
_dim : an array containing the dimension of each patch (size : number of patchs)
_Nkv : a 2D array containing the number of knots for each patch (shape : 3, number of patchs)
_Ukv : a list containing the knot vectors for each patch (length : number of patchs). Each element of the list _Ukv is a list of size 3 containing an array representing with the knot values of the patch in each parametric direction
_Jpqr : a 2D array containing the degrees of each patch in each direction (shape : 3, number of patchs)
_Nijk : a 2D array containing the knot span for each element in each direction (shape : 3, total number of elements)
_weight : a list containing the weights for each element (length : total number of elements). Each element of the list is an array whose size is number of control points of the element
_elementsByPatch : an array containing the number of elements for each patch (size : number of patchs)
_nb_patch : a scalar containg the number of patchs
_nnode : an array containing the number of control points per element for each patch (size : number of patchs)
_nb_elem : a scalar containing the total number of elements
Other informations
_indCPbyPatch : an array containing the indices of control points for each patch (size : number of patchs). Each element of the array is an array containing the indices of the control points for a given patch (size : number of control points of the corresponding patch)
Class members (TEST)
- class yeti_iga.preprocessing.igaparametrization.IGAparametrization(mechanicalSettings=None, geometricSettings=None, filename=None)
A class containing the necessary parameters for IGA.
- _autoset_indCPbyPatch()
Automatic computation of control point indices by patch.
- _compute_vectWeight()
Build ordered NURBS weight vector.
- _flatten_data()
Flatten all geometric or mechanical attributes arrays.
This method is used for passing arguments to the FORTRAN part of the code, which is taking only flattened arrays.
- _get_bcs_info()
Get attributes related to boundary conditions.
- _get_indCPbyPatch()
Get control points indices for each patch.
- _get_load_info()
Get attributes related to loads.
- _get_vectWeight()
Get NURBS weight vector.
- _initRefinementMatHistory()
Initialise _refinementMatHistory to track refinement steps.
- _set_indCPbyPatch(indCPbyPatch)
Set control points indices for each patch.
- _updateNodalField(fieldinit)
Update a nodal field according to the previous refinement steps.
- Parameters:
fieldinit (array of floats) – The initial field which discretization level corresponds to the initial geometry.
- Returns:
field – The same field but discretized as the current geometry.
- Return type:
array of floats
- _updateRefinementMatHistory(transformationMatrices)
Update _refinementMatHistory according to a refinement step.
- Parameters:
transformationMatrices (list of sparse matrices) – The matrices that transform the control points from a coarser to a finer mesh. Those matrices are considered to be as given by the function refine_and_getTransformationMatrices.
- _update_dof_info()
Set degrees of freedom information.
- add_multiplePatch(patchMechSet, patchGeoSet)
- Parameters:
patchMechSet (TYPE) – DESCRIPTION.
patchGeoSet (TYPE) – DESCRIPTION.
- Return type:
None.
- add_patch(patchMechSet, patchGeoSet, mode=0)
Add a patch to current IGAparametrization object.
- Parameters:
patchMechSet (TYPE) – DESCRIPTION.
patchGeoSet (TYPE) – DESCRIPTION.
mode (TYPE, optional) – DESCRIPTION. The default is 0.
- Return type:
None.
- property coords
Coordinates of control points
- property design_parameters
TODO Document this property
- property dim
document this property
- Type:
TODO
- property elt_type
document this property
- Type:
TODO
- generate_vtk4controlMeshVisu(filename, num_patch, sol=None, output_path='results')
Generate control mesh visualisation for a given patch number.
- get_geometricSettings()
Get the geometrical settings.
- get_geometricSettings_somePatch(listpatch)
Get the geometrical settings of a given patch.
- get_inputs4adjointdisp(xi, numpatch=1)
- Parameters:
xi (TYPE) – DESCRIPTION.
numpatch (TYPE, optional) – DESCRIPTION. The default is 1.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4area(COORDS=None, activepatch=None)
- Parameters:
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activepatch (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4bandInfos()
SHORT DESCRIPTION.
- get_inputs4controlMesh(filename, num_patch, output_path='results', sol=None)
- Parameters:
filename (TYPE) – DESCRIPTION.
num_patch (TYPE) – DESCRIPTION.
sol (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4cplgEmbddEntites(nb_diag=None, NUMDof2Diag=None)
- Parameters:
nb_diag (TYPE, optional) – DESCRIPTION. The default is None.
NUMDof2Diag (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4cplginfos(nb_pts=3)
SHORT DESCRIPTION.
- get_inputs4cplgmatrix(COORDS=None)
SHORT DESCRIPTION.
- get_inputs4cplgmatrixU5(COORDS=None, integrationOrder=0, output_path='results')
Generate input arguments for
coupling.cplgmatrix.cplg_matrixu5.- Parameters:
COORDS (list, optional) – Control points coordinates. The default is None.
integrationOrder (int, optional) – Integration order for coupling equation (used only if greater than auto-evaluated one). The default is 0.
output_path (string) – Path to directory where debug files (for projection) should be written.
- Returns:
inputs – List of parameters for
coupling.cplgmatrix.cplg_matrixu5.- Return type:
list
- get_inputs4dirichletmatrix()
SHORT DESCRIPTION.
- get_inputs4dlmmat()
SHORT DESCRIPTION.
- get_inputs4entities2param()
SHORT DESCRIPTION.
- get_inputs4eval_coupling_gpts(filename, npts_u, npts_v)
Return the necessary data to evaluate coupling Gauss points coordinates
- Parameters:
filename (str) – base name for resulting files
npts_u (int) – number of points to compute along u parametric direction
npts_v (int) – number of points to compute along v parametric direction
- Returns:
the necessary input parameters for Fortran subroutine
eval_coupling_gpts- Return type:
dict
- get_inputs4evaldisp(sol, xi, numpatch=1)
- Parameters:
sol (TYPE) – DESCRIPTION.
xi (TYPE) – DESCRIPTION.
numpatch (TYPE, optional) – DESCRIPTION. The default is 1.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4evaldispmulti(sol, n_xi, n_eta, n_zeta, numpatch=1)
- Parameters:
sol (TYPE) – DESCRIPTION.
n_xi (TYPE) – DESCRIPTION.
n_eta (TYPE) – DESCRIPTION.
n_zeta (TYPE) – DESCRIPTION.
numpatch (TYPE, optional) – DESCRIPTION. The default is 1.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4evalstress(sol, xi, numpatch=1)
- Parameters:
sol (TYPE) – DESCRIPTION.
xi (TYPE) – DESCRIPTION.
numpatch (TYPE, optional) – DESCRIPTION. The default is 1.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4gauss3D(KNumFace=0)
SHORT DESCRIPTION.
- get_inputs4geomat(sol, case=1)
- Parameters:
sol (TYPE) – DESCRIPTION.
case (TYPE, optional) – DESCRIPTION. The default is 1.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4gradCompliance(sol, epsilon=0.0001, COORDS=None, activeElem=None, activeDir=array([1, 1, 1]))
- Parameters:
sol (TYPE) – DESCRIPTION.
epsilon (TYPE, optional) – DESCRIPTION. The default is 1.e-4.
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activeElem (TYPE, optional) – DESCRIPTION. The default is None.
activeDir (TYPE, optional) – DESCRIPTION. The default is np.ones(3, np.intp).
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4gradCoupling(sol, COORDS=None, activepatch=None)
- Parameters:
sol (TYPE) – DESCRIPTION.
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activepatch (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4gradDisplacement(sol, ADJ, COORDS=None, activeElem=None, activeDir=array([1, 1, 1]))
- Parameters:
sol (TYPE) – DESCRIPTION.
ADJ (TYPE) – DESCRIPTION.
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activeElem (TYPE, optional) – DESCRIPTION. The default is None.
activeDir (TYPE, optional) – DESCRIPTION. The default is np.ones(3, np.intp).
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4gradTotalwork(sol, ADJ, COORDS=None, activeElem=None, activeDir=array([1, 1, 1]))
- Parameters:
sol (TYPE) – DESCRIPTION.
ADJ (TYPE) – DESCRIPTION.
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activeElem (TYPE, optional) – DESCRIPTION. The default is None.
activeDir (TYPE, optional) – DESCRIPTION. The default is np.ones(3, np.intp).
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4gradVibration(eigenvect, eigenval, COORDS=None, activeElem=None, activeDir=array([1, 1, 1]))
- Parameters:
eigenvect (TYPE) – DESCRIPTION.
eigenval (TYPE) – DESCRIPTION.
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activeElem (TYPE, optional) – DESCRIPTION. The default is None.
activeDir (TYPE, optional) – DESCRIPTION. The default is np.ones(3, np.intp).
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4grammat()
Generate input for the routine computing Gram matrix
- get_inputs4grevphyscoords(activePatch=None)
SHORT DESCRIPTION.
- get_inputs4indDOF()
Get the settings concerning fixed and free degrees of freedom.
- get_inputs4interpolation(activePatch=None, listParam=None)
- Parameters:
activePatch (TYPE, optional) – DESCRIPTION. The default is None.
listParam (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4lagrangeCplgMatrx(Mult, IGJELEM, GaussCoordsGlo)
- Parameters:
Mult (TYPE) – DESCRIPTION.
IGJELEM (TYPE) – DESCRIPTION.
GaussCoordsGlo (TYPE) – DESCRIPTION.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4massmat(COORDS=None, activeElem=None)
- Parameters:
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activeElem (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4post_curve_2D(i_patch, i_face, n_sample, sol)
Get the necessary inputs for function postproc.XXXXXXXXXXXXX in order to compute mechanical quantities (displacement and displacement gradient) along a curve for a 2D problem
- Parameters:
i_patch (int) – Index of patch to process (starts at 1)
i_face (int) – Index of side curve to process (1, 2, 3 or 4)
n_sample (int) – Number of sample points to generate
sol (numpy array) – Problem solution
- Returns:
inputs – Necessary inputs for function postproc.postproc_curve_2D
- Return type:
dict
- get_inputs4postprocBasisFcts(filename, activepatch=None, dervorder=0, nb_pts=5)
- Parameters:
filename (TYPE) – DESCRIPTION.
activepatch (TYPE, optional) – DESCRIPTION. The default is None.
dervorder (TYPE, optional) – DESCRIPTION. The default is 0.
nb_pts (TYPE, optional) – DESCRIPTION. The default is 5.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4postprocCPLG(filename, sol, nb_ref=5, Flag=array([True, False, False]))
- Parameters:
filename (TYPE) – DESCRIPTION.
sol (TYPE) – DESCRIPTION.
nb_ref (TYPE, optional) – DESCRIPTION. The default is 5.
Flag (TYPE, optional) – DESCRIPTION. The default is np.array([True, False, False]).
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4postprocPtsCloud(filename, activepatch=None, nb_pts=5)
- Parameters:
filename (TYPE) – DESCRIPTION.
activepatch (TYPE, optional) – DESCRIPTION. The default is None.
nb_pts (TYPE, optional) – DESCRIPTION. The default is 5.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4postprocVTU(filename, sol, nb_ref=array([1, 1, 1]), Flag=array([True, True, True]), output_path='results')
Get the necessary inputs for .vtu file generation.
- Parameters:
filename (str) – Name of the output .vtu file.
sol (numpy array) – Displacement field to plot. The function get_inputs4solution can be used for this purpose.
nb_ref (numpy array, optional) – Mesh refinement for visualisation. It takes the form: np.array([xi-dir., eta-dir., zeta-dir.]. The default is np.ones(3).
Flag (numpy array, optional) – Field ouput to save. Three are available: Nodal displacement, stresses, and Von Mises stresses. The default is np.array([True, True, True]).
output_path (string) – Path to the directory where the output file should be written
- Returns:
inputs – Necessary inputs for generating the .vtu file.
- Return type:
list
- get_inputs4postproc_bezier(i_patch, filename, sol, output_path='results')
Get the necessary inputs for VTU postprocessing using Bezier cells with function postprocessing.postproc.generate_vtu_bezier Ouptut is made for a given patch of type U1
- Parameters:
i_patch (int) – Index of patch to process (starts at 1)
filename (str) – Name of output .vtu file
sol (numpy array) – Displacement field to plot
- Returns:
inputs – Necessary inputs for VTU postprocessing using Bezier cells with function postprocessing.postproc.generate_vtu_bezier
- Return type:
dict
- get_inputs4postproc_cplg_vtu(filename, lgrge_patch_number, sol, nb_ref=array([1., 1.]), output_path='results')
Returns the inputs for the generation of VTU file for results at coupling interface
- Parameters:
filename (string) – Name of the file to write without extension
lgrge_patch_number (int) – Index of Lagrange patch number of the interface to process
sol (numpy.array) – Displacement field solution
nb_ref (numpy.array) – mesh refinement level in each direction. default is [1, 1]
- Returns:
inputs – List of input parameters for pp.generate_coupling_vtu
- Return type:
list
- get_inputs4postproc_faces_vtu(filename, nb_ref=array([1., 1., 1.]), output_path='results')
Get the necessary inputs for function postproc.generate_faces_vtu
- Parameters:
filename (str) – Name of the output .vtu file
nb_ref (numpy array, optional) – Mesh refinement for the visualisation. It takes the form: np.array([xi-dir., eta-dir., zeta-dir.]). The default is np.ones(3)
output_path (string) – Path to the directory where the output file should be written. The default is ‘results’
- Returns:
inputs – Necessary inputs for function postproc.generate_faces_vtu
- Return type:
dict
- get_inputs4proj_vtu(filename, sol, svars, nb_ref=array([1., 1., 1.]), output_path='results')
Return the inputs for least squer projection in a VTU file.
- Parameters:
filename (string) – Name of the file to write without extension
sol (numpy.array) – Displacement field solution
svars (numpy.array) – variables originally defined at integration points and mean-square projected on CP
nb_ref (numpy.array) – Mesh refinement level in each direction. Default is [1, 1, 1]
outout_path (string) – path to output directory, default is ‘results’
- Returns:
inputs – list of input parameters for pp.generate_pro_vtu
- Return type:
list
- get_inputs4regularizationaggreg(ptseval, pnorm=10)
- Parameters:
ptseval (TYPE) – DESCRIPTION.
pnorm (TYPE, optional) – DESCRIPTION. The default is 10.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4solution(U_inv)
Return the necessary data for reconstructing nodal displacement.
- get_inputs4strainExtrmm(sol)
SHORT DESCRIPTION.
- get_inputs4stressaggreg(sol, pnorm=10)
- Parameters:
sol (TYPE) – DESCRIPTION.
pnorm (TYPE, optional) – DESCRIPTION. The default is 10.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4stressaggregDiscrete(sol, ptseval, pnorm=10)
- Parameters:
sol (TYPE) – DESCRIPTION.
ptseval (TYPE) – DESCRIPTION.
pnorm (TYPE, optional) – DESCRIPTION. The default is 10.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4svarsrhs(sol)
Generate input for the routine computing RHS vectors of the least square projection of values at Gauss points
- Parameters:
sol (np.array) – displacement solution at control points
- get_inputs4system(COORDS=None)
SHORT DESCRIPTION.
- get_inputs4system_bandStorage(nb_diag=None, NUMDof2Diag=None, COORDS=None, activeElem=None)
- Parameters:
nb_diag (TYPE, optional) – DESCRIPTION. The default is None.
NUMDof2Diag (TYPE, optional) – DESCRIPTION. The default is None.
COORDS (TYPE, optional) – DESCRIPTION. The default is None.
activeElem (TYPE, optional) – DESCRIPTION. The default is None.
- Returns:
inputs – DESCRIPTION.
- Return type:
TYPE
- get_inputs4system_elemStorage(COORDS=None, activeElem=None)
Return parameters to compute the sparse stiffness matrix.
Data is structured to comply with the function input parameters. The functions is stiffmtrx_elemstorage.sys_linmat_lindef_static
- Parameters:
COORDS (numpy array, optional) – Control points coordinates. The default is None. Default correponds to the coordinates of the current geometry.
activeElem (numpy array (dtype=intp), optional) – Array indicating elements considered to build the stiffness matrix. Value 1 stands for active elements. The default is None (all elements are activated).
- Returns:
inputs – All necessary inputs to build stiffness matrix.
- Return type:
list
- get_mechanicalSettings()
Get the object’s mechanical settings.
- get_mechanicalSettings_somePatch(listpatch, with_bc=False, updatePROPS=False)
Get the mechanical settings for a given patch.
- Parameters:
listpatch (list of ints) – List of indices corresponding to the patche(s) of interest.
with_bc (boolean, optional) – Adds boundary conditions to the returned list if set to True. The default is False.
updatePROPS (boolean, optional) – Updates the object’s properties if set to True. The default is False.
- Returns:
mechSet – List of ordered mechanical settings.
- Return type:
list
- property ien
document this property
- Type:
TODO
- property ind_cp_by_patch
document this property
- Type:
TODO
- property ind_dof_free
Indices of unblocked degrees of freedom
- property j_pqr
Degrees for all patchs
- property n_kv
knot vectors size for all patchs
- property nb_cp
document this property
- Type:
TODO
- property nb_dof_free
Number of unblocked degrees of freedom
- property nb_dof_tot
Total number of degrees of freedom
- property nb_patch
” Total number of patchs in the model
- property num_integration_points
document this property
- Type:
TODO
- refine(nb_refinementByDirection, nb_degreeElevationByDirection=array([0, 0, 0]), additional_knots=None)
Refinement by degree elevation and knot insertion.
For more details on the function’s arguments see the function
refine_and_getTransformationMatrices. The present function does not return the transformation matrices for refinement.
- refine_and_getTransformationMatrices(nb_refinementByDirection, nb_degreeElevationByDirection=[0, 0, 0], additional_knots=None)
Refinement by degree elevation and knot insertion.
For knot insertion, a level of refinement consists in inserting all of the average knots of non-zero intervals. The number of elements is hence doubled.
- Parameters:
nb_refinementByDirection (list of ints) –
- Level of refinement by direction.
It takes the form: [xi-dir., eta-dir., zeta-dir.].
nb_degreeElevationByDirection (list of ints, optional) –
- Number of degree elevation by direction. The default is [0, 0, 0].
It takes the form:[xi-dir., eta-dir., zeta-dir.].
additional_knots (dict, optional) –
- Dictionnary for specific knot insertion. The default is None.
The dictionay takes the following keywords: patches, 1, 2, 3.
- Example:
Refine the patch indexed as 2 at parameters u=0.5 and w=0.8. Hence we have: additional_knots = {‘patches’: np.array([2]), ‘1’: np.array([0.5]), ‘2’: np.array([]), ‘3’: np.array([0.8])}.
- Returns:
transformationMatrices – Resulting transformation matrices for refinement.
- Return type:
numpy array
- set_geomectricSettings(newGeoSet)
Set the geometrical settings.
- set_mechanicalSettings(newMechSet)
Set the mechanical settings.
- shapeupdate()
Apply the shape update.
The shape update is defined by defined by the attribute _shapeparametrization_def.
The design parameters (names and values) are set in the attribute _design_parameters, and are taken as the inputs.
The function updates the control point coordinates _COORDS.
- writeCOORDS(filename)
Write the control points coordinates to file, ordered by patch.
- writeCOORDS_tot(filename)
Write all control points coordinates.