Model

class compas_fea2.model.Model[source]

Bases: FEAData

Class representing an FEA model.

Parameters:
descriptionstr, optional

Some description of the model, by default None. This will be added to the input file and can be useful for future reference.

authorstr, optional

The name of the author of the model, by default None. This will be added to the input file and can be useful for future reference.

Attributes:
descriptionstr

Some description of the model.

authorstr

The name of the author of the model.

partsSet[compas_fea2.model.Part]

Return all the parts registered to the Model.

bcsDict[compas_fea2.model._BoundaryCondition, Set[compas_fea2.model.Node]]

Return the boundary conditions of the model.

tbcsDict[compas_fea2.model._ThermalBoundaryCondition, Set[compas_fea2.model.Node]]

Dictionary with the thermal boundary conditions of the model and the nodes where these are applied.

icsDict[compas_fea2.model._InitialCondition, Set[Union[compas_fea2.model.Node, compas_fea2.model._Element]]]

Return the initial conditions of the model.

constraintsSet[compas_fea2.model._Constraint]

Return the constraints of the model.

partgroupsSet[compas_fea2.model.PartsGroup]

The part groups of the model.

materialsSet[compas_fea2.model.Material]

Return a set of all materials in the model.

sectionsSet[compas_fea2.model.Section]

Return a set of all sections in the model.

problemsSet[compas_fea2.problem.Problem]

Return all the problems registered to the Model.

pathpathlib.Path

Return the path of the model.

Notes

Quantities such as volume and gravity are exposed in the active unit system. See compas_fea2.units for configuration.

Methods

add_bcs

Add a :class=`compas_fea2.model.BoundaryConditionsField` to the model.

add_clampXX_bc

Add a :class=`compas_fea2.model.bcs.ClampBCXX` to the given nodes.

add_clampYY_bc

Add a :class=`compas_fea2.model.bcs.ClampBCYY` to the given nodes.

add_clampZZ_bc

Add a :class=`compas_fea2.model.bcs.ClampBCZZ` to the given nodes.

add_connector

Add a connector to the model.

add_constraint

Add a constraint to the model.

add_constraints

Add multiple constraints to the model.

add_fix_bc

Add a :class=`compas_fea2.model.bcs.FixedBC` to the given nodes.

add_group

Add a group to the model.

add_groups

Add multiple groups to the model.

add_ics

Add a :class=`compas_fea2.model._InitialCondition` to the model.

add_ics_fields

add_interaction

Add an interaction to the model.

add_interactions

Add multiple interactions to the model.

add_interface

compas_fea2.model.Interface

add_interfaces

Add multiple compas_fea2.model.Interface objects to the model.

add_part

Adds a Part to the Model.

add_parts

Add multiple parts to the model.

add_pin_bc

Add a :class=`compas_fea2.model.bcs.PinnedBC` to the given nodes.

add_problem

Add a problem to the model.

add_problems

Add multiple problems to the model.

add_rollerXY_bc

Add a compas_fea2.model.bcs.RollerBCXY to the given nodes.

add_rollerXZ_bc

Add a compas_fea2.model.bcs.RollerBCXZ to the given nodes.

add_rollerX_bc

Add a :class=`compas_fea2.model.bcs.RollerBCX` to the given nodes.

add_rollerYZ_bc

Add a compas_fea2.model.bcs.RollerBCYZ to the given nodes.

add_rollerY_bc

Add a :class=`compas_fea2.model.bcs.RollerBCY` to the given nodes.

add_rollerZ_bc

Add a :class=`compas_fea2.model.bcs.RollerBCZ` to the given nodes.

add_thermal_bc

Add a compas_fea2.model.bcs.ThermalBC to the model.

add_uniform_thermal_ics_field

array_parts

Create an array of parts by applying a transformation multiple times.

assign_keys

Assign keys to the model and its parts.

clear

Clear the model.

contains_material

Verify that the model contains a specific material.

contains_node

Verify that the part contains a given node.

contains_part

Verify that the model contains a specific part.

contains_section

Verify that the model contains a specific section.

copy_part

Copy a part and apply a transformation.

find_closest_nodes_to_node

Find the n closest nodes around a given node (excluding the node itself).

find_closest_nodes_to_point

Find the closest number_of_nodes nodes to a given point.

find_element_by_key

Retrieve an element in the model using its key.

find_element_by_name

Find all elements with a given name.

find_faces_in_polygon

Find the faces of the elements that are contained within a planar polygon.

find_material_by_key

Find a material by key.

find_material_by_name

Find a material by name.

find_materials_by_attribute

Find materials by attribute.

find_node_by_key

Retrieve a node in the model using its key.

find_node_by_name

Find a node with a given name.

find_nodes_in_polygon

Find the nodes of the part that are contained within a planar polygon.

find_nodes_on_plane

Find all nodes on a given plane.

find_part_by_name

Find if there is a part with a given name in the model.

find_section_by_key

Find a section by key.

find_section_by_name

Find a section by name.

find_sections_by_attribute

Find sections by attribute.

from_template

Create a Model instance from a template.

group_parts_where

Create a group of parts with an attribute that satisfies a condition.

remove_bcs

Release nodes that were previously restrained.

remove_nodes_from_bcs

Remove nodes from a boundary condition field.

reset

Reset the model.

summary

Return a summary of the model.

Inherited Methods

ToString

Converts the instance to a string.

copy

Make an independent copy of the data object.

from_json

Construct an object of this type from a JSON file.

from_jsonstring

Construct an object of this type from a JSON string.

sha256

Compute a hash of the data for comparison during version control using the sha256 algorithm.

to_json

Convert an object to its native data representation and save it to a JSON file.

to_jsonstring

Convert an object to its native data representation and save it to a JSON string.

validate_data

Validate the data against the object's data schema.