diff --git a/readme.md b/readme.md index b1064f7..44fc8d3 100644 --- a/readme.md +++ b/readme.md @@ -7,3 +7,9 @@ Currently the project can only be used to solve beam element problems where all by boundary conditions, but this will be improved in future. The project also has no GUI for defining the problem at the moment, and must be written in rust (see [`src/bin/two_d.rs`](./src/bin/two_d.rs) for an example of setting up a problem). + +# Format Specifications + +The project will likely be composed of multiple independent programs as it is developed. +The formats specified in the [specs folder](./specs) will be used to to exchange information between +the programs. diff --git a/specs/pd2v1.md b/specs/pd2v1.md new file mode 100644 index 0000000..1f7bb9f --- /dev/null +++ b/specs/pd2v1.md @@ -0,0 +1,111 @@ +# 2D Problem Definition Version 1 (PD2v1) Specification + +A format for defining shapes that humans and machines can read. + +I think it should have a better name. + +## Usage + +### Beam Elements (BE) + +Beam element problem definitions use points to represent nodes and links to represent +beams. + +A given point (node) can be connected to any number of links (beams). + +### Finite Elements (FE) + +Finite element problem definitions use points to represent nodes and links to represent +edges. + +A given point (node) can only be connected to two links (edges). + +### Mesh + +The spec can also be used to export meshes by using fixed boundary conditions and definining a set +of `LINK_PROPS` that can be ignored (i.e. `LINK_PROPS ignore 0 0`). + +## Types + +### REAL + +A real number + +#### Examples + +``` +0 +-1 +1 +-1.0 +1.0 +9999999.999999 +``` + +### IDs (`ID`) + +String that can include numbers, letters, underscores (`_`), and dashes (`-`). + +### Boundary condition types (`BC_TYPE`) + +- `NONE` +- `FIXED` +- `FORCE ` + +## Syntax + +### Comments + +``` +// comments begin with // and end at the end of a line +``` + +### Definitions + +Each definiton goes on its own line. +Definitons cannot refer to IDs of objects that are defined in latter lines. + +Every ID given for every object must be unqiue amongst its object type but not between types (although it is fine if it is). +All definitions are immutable. + +| Object Type | Syntax | +|--------------------|----------------------------------------------------------| +| Boundary Condition | `BOUNDARY_CONDITION ` | +| Link | `LINK ` | +| Link Properties | `LINK_PROPS ` | +| Material | `MATERIAL ` | +| Point | `POINT ` | +| Vector | `VEC ` | + + +## Example + +### Beam Element + +``` +// Define a fixed boundary conditon as it can be shared by all fixed points +BOUNDARY_CONDITION bc_fixed FIXED +MATERIAL aluminium 210000000000 250000000 +LINK_PROPS beam_props aluminium 0.0019635 + +// Define the first node +VEC point1_pos 0 0 +POINT point1 point1_pos bc_fixed + +// Define node with force boundary condition +VEC point4_pos 1.7321 1 +VEC bc4_mag 14142 14142 +BOUNDARY_CONDITION bc4 FORCE bc4_mag +POINT point4 point4_pos bc4 + +// Define rest of the nodes +VEC point2_pos 0 1.1547 +POINT point2 point2_pos bc_fixed +VEC point3_pos 0 4.4641 +POINT point3 point3_pos bc_fixed + +// And finally link the nodes together to create the beams +LINK link1 beam_props point1 point4 +LINK link2 beam_props point2 point4 +LINK link3 beam_props point3 point4 +``` diff --git a/todo b/todo new file mode 100644 index 0000000..930d09d --- /dev/null +++ b/todo @@ -0,0 +1,5 @@ +add support for parsing PD2v1 files for beam element programs +create program to help make PD2v1 files by drawing on canvas +expand beam element solver to be able to solve problems with nodes with no boundary conditions + +support finite element solving