Skip to content

Commit

Permalink
tutorial update
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Dec 6, 2023
1 parent fe3de47 commit 102e648
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 0 deletions.
72 changes: 72 additions & 0 deletions docs/userguide/basics.data.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
******************************************************************************
Data
******************************************************************************

An analysis with COMPAS FEA2 is defined by a "model" (:class:`compas_fea2.model.Model`)
and a "problem" (:class:`compas_fea2.problem.Problem`), with each many different sub-components.

All these components, and the model and problem themselves, are COMPAS data objects,
and derive from a base FEA2 data class (:class:`compas_fea2.base.FEAData`).

.. code-block:: None
compas.data.Data
|_ compas_fea2.base.FEAData
|_ compas_fea2.model.Model
|_ compas_fea2.model.Node
|_ compas_fea2.model.Element
|_ ...
|_ compas_fea2.model.Part
|_ ...
|_ compas_fea2.model.Material
|_ ...
|_ compas_fea2.model.Section
|_ ...
|_ compas_fea2.model.Constraint
|_ ...
|_ compas_fea2.model.Group
|_ ...
|_ compas_fea2.model.BoundaryCondition
|_ ...
|_ compas_fea2.model.InitialCondition
|_ ...
.. code-block:: None
compas.data.Data
|_ compas_fea2.base.FEAData
|_ compas_fea2.problem.Problem
|_ compas_fea2.problem.Step
|_ ...
|_ compas_fea2.problem.Load
|_ ...
|_ compas_fea2.problem.Displacement
|_ ...
This means that all these components have the same base data infrastructure as all other COMPAS objects.
They have a guid, a name, and general attributes.

>>> from compas_fea2.model import Node
>>> node = Node(name='node')
>>> node.name
'node'
>>> node.guid
...
>>> node.attributes
{}

The can be converted to data and serialised to a JSON string or file.

>>> node.to_data()
{'name': 'node', 'guid': ..., 'attributes': {}}
>>> node.to_jsonstring()
'{"name": "node", "guid": ..., "attributes": {}}'

The only difference from other COMPAS objects is their default name.

>>> node = Node()
>>> node.name
...

60 changes: 60 additions & 0 deletions docs/userguide/basics.model.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
******************************************************************************
Model
******************************************************************************

At the heart of every COMPAS FEA2 analysis or simluation is a model.
A model consists of nodes, elements and parts,
and defines connections, constraints and boundary conditions.

>>> from compas_fea2.model import Model
>>> model = Model()
>>> model

Nodes
=====

Nodes are the basic building blocks of a model.
They define the locations in space that define all other entities.

>>> from compas_fea2.model import Node
>>> node = Node(x=0, y=0, z=0)
>>> node
Node(...)
>>> node.x
0.0
>>> node.y
0.0
>>> node.z
0.0
>>> node.xyz
[0.0, 0.0, 0.0]
>>> node.point
Point(0.0, 0.0, 0.0)

Besides coordinates, nodes have many other (optional) attributes.

>>> node.mass
[None, None, None]
>>> node.temperature
None
>>> node.dof
{'x': True, 'y': True, 'z': True, 'xx': True, 'yy': True, 'zz': True}
>>> node.loads
{}
>>> node.displacements
{}

Nodes also have a container for storing calculation results.

>>> node.results
{}


Elements
========

Elements are defined by the nodes they connect to and a section.


>>>


Parts
=====
3 changes: 3 additions & 0 deletions docs/userguide/basics.overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
******************************************************************************
Model
******************************************************************************
4 changes: 4 additions & 0 deletions docs/userguide/gettingstarted.nextsteps.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
********************************************************************************
Next Steps
********************************************************************************

3 changes: 3 additions & 0 deletions docs/userguide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ User Guide
gettingstarted.intro
gettingstarted.requirements
gettingstarted.installation
gettingstarted.nextsteps

.. toctree::
:maxdepth: 2
:titlesonly:
:caption: Tutorial

basics.overview
basics.data
basics.model
basics.problem
basics.analysis
Expand Down

0 comments on commit 102e648

Please sign in to comment.