Class Assembly
- class Assembly(weakform, mesh='', elm_type='', name='', **kargs)
Fedoo Assembly object.
This class is one of the main object of fedoo that is dedicated to all that is related to global matrices assembly. Basically, an Assembly object is build upon a weakform (equation written using a weak formulation), a mesh, a type of element and a number of integration points (gauss points).
- Parameters:
weakform (WeakForm instance) – weakform associated to the assembly
mesh (Mesh instance) – domain over which the weakform should be integrated
elm_type (str) – Type of the element used for the field interpolation. This element may be different that the one used for the geometrical interpolation defined in mesh.elm_type.
name (str) – The name of the assembly
n_elm_gp (number of gauss points per element for the numerical integration.) – To use with caution. By default, this value is set automatically for each element type. A non default number of integration points may be forced using this argument.
Notes
To launch the assembling, use the method “assemble_global_mat()” Then, the assembled global matrix and global vector are stored in the attributes “global_matrix” and “global_vector”.
- assemble_global_mat(compute='all')
Compute the global matrix and global vector related to the assembly if compute = ‘all’, compute the global matrix and vector if compute = ‘matrix’, compute only the matrix if compute = ‘vector’, compute only the vector if compute = ‘none’, compute nothing
- copy(new_id='')
Return a raw copy of the assembly without keeping current state (internal variable).
- Parameters:
new_id (TYPE, optional) – The name of the created constitutive law. The default is “”.
- Return type:
The copy of the assembly
- static delete_memory()
Static method of the Assembly class. Erase all the static variables of the Assembly object. Stored data, are data that are used to compute the global assembly in an efficient way. However, the stored data may cause errors if the mesh is modified. In this case, the data should be recomputed, but it is not done by default. In this case, deleting the memory should resolve the problem.
Note: it the MeshChange argument is set to True when creating the Assembly object, the memory will be recomputed by default, which may cause a decrease in assembling performances
- get_element_results(operator, U)
Return some element results based on the finite element discretization of a differential operator on a mesh being given the dof results and the type of elements.
- Parameters:
mesh (string or Mesh) – If mesh is a string, it should be a meshname. Define the mesh to get the results from
operator (DiffOp) – Differential operator defining the required results
U (numpy.ndarray) – Vector containing all the DoF solution
Return (numpy.ndarray) – A Vector containing the values on each element. It is computed using an arithmetic mean of the values from gauss points The vector lenght is the number of element in the mesh
- get_gp_results(operator, U, n_elm_gp=None, use_local_dof=False)
Return some results at element Gauss points based on the finite element discretization of a differential operator on a mesh being given the dof results and the type of elements.
- Parameters:
operator (DiffOp) – Differential operator defining the required results
U (numpy.ndarray) – Vector containing all the DoF solution
use_local_dof (bool, default: False) – if True, U is interpreted as local dof for each node in element The dof should be ordered so that U.reshape(mesh.n_elm_nodes, space.nvar, mesh.n_elements)[i,var,el] gives the value of the variable var (variable indice) for the ith nodes of the element el.
Return (numpy.ndarray) – A Vector containing the values on each point of gauss for each element. The vector lenght is the number of element time the number of Gauss points per element
- get_grad_disp(U, Type='Node')
Return the Gradient Tensor of a vector (generally displacement given by Problem.get_DofSolution(‘all’) as a list of list of numpy array The total displacement field U has to be given as a flatten numpy array see get_node_results and get_element_resultss
Options : - Type :”Node”, “Element” or “GaussPoint” integration (default : “Node”)
- get_int_forces(U, CoordinateSystem='global')
Only available for 2 nodes beam element Return the element internal Forces and moments related to a specific assembly considering the DOF solution given in U. Return array whose columns are Fx, Fy, Fz, Mx, My and Mz.
- Parameter: if CoordinateSystem == ‘local’ the result is given in the local coordinate system
if CoordinateSystem == ‘global’ the result is given in the global coordinate system (default)
- get_node_results(operator, U)
Return some node results based on the finite element discretization of a differential operator on a mesh being given the dof results and the type of elements.
- Parameters:
operator (DiffOp) – Differential operator defining the required results
U (numpy.ndarray) – Vector containing all the DoF solution
Return (numpy.ndarray) – A Vector containing the values on each node. An interpolation is used to get the node values from the gauss point values on each element. After that, an arithmetic mean is used to compute a single node value from all adjacent elements. The vector lenght is the number of nodes in the mesh
- get_strain(U, Type='Node', nlgeom=None)
Not a static method. Return the Green Lagrange Strain Tensor of an assembly using the Voigt notation as a python list. The total displacement field has to be given. see get_node_results and get_element_results
Options : - Type :”Node”, “Element” or “GaussPoint” integration (default : “Node”) - nlgeom = True or False if the strain tensor account for geometrical non-linearities if nlgeom = False, the Strain Tensor is assumed linear (default : True)
example : S = SpecificAssembly.get_strain(Problem.Problem.get_dof_solution(‘all’))
- initialize(pb)
Initialize the associated weak form and assemble the global matrix with the elastic matrix.
- Parameters:
pb (-) – the problem associated to the assembly
- property n_gauss_points
- returns: The total number of integration points (ie Gauss points) associated to the assembly.
n_gauss_points is the total number of Gauss points whereas n_elm_gp gives only he numbre of gauss points per element: n_gauss_points = mesh.n_elements + assembly.n_elm_gp.
- Return type:
int
- reset()
reset the assembly to it’s initial state. Internal variable in the constitutive equation are reinitialized and stored global matrix and vector are deleted
- set_start(pb)
Apply the modification to the constitutive equation required at each new time increment. Generally used to increase non reversible internal variable Assemble the new global matrix.
- property state_variables
Alias for the sv dict containing the state variables.
- static sum(*listAssembly, name='', **kargs)
Return a new assembly which is a sum of N assembly. Assembly.sum(assembly1, assembly2, …, assemblyN, name =””, reload = [1,4] )
The N first arguments are the assembly to be summed. name is the name of the created assembly: reload: a list of indices for subassembly that are recomputed at each time the summed assembly is Launched. Default is ‘all’ (equivalent to all indices).
- sv
Dictionary of state variables associated to the current problem.
- to_start(pb)
reset the current time increment (internal variable in the constitutive equation) Doesn’t assemble the new global matrix. Use the Update method for that purpose.
- update(pb, compute='all')
Update the associated weak form and assemble the global matrix :param - pb: a Problem object containing the Dof values