forked from 1b-agent/fieldcraft-upstream
1D elements I: trusses (rod2, rod3), point masses, rotary inertia, springs and dashpots (#38)
* Model, fem and decks: point masses, rotary inertia, springs, dashpots and rod3 trusses Model: PointMass and Spring definitions (spring | dashpot; to ground or two-point; along a degree of freedom, a vector or the line of the ends) on a set or reference point, resolved per node; ElementKind::Rod3. fem: rod2/rod3 truss kernel on Basis::Line2/Line3 declaring ElementDofs (translations). Decks: Abaqus T3D3, MASS, ROTARYI, SPRING1/2/A, DASHPOT1/2/A; Nastran CONM1, CELAS2, CDAMP2; LS-DYNA ELEMENT_MASS/INERTIA and ELEMENT_DISCRETE; what a format cannot take is reported. Commands model.mass.* and model.spring.*. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * Implicit solver: trusses, point masses, rotary inertia and springs on the DofLayout Trusses declare their translations like solids; point masses, inertia and springs ask the layout for the kinds they need at their nodes (translations, rotations), and reference points they use get six degrees of freedom. The matrix pattern takes rows for those points; dashpots are ignored with a warning. Existing results are bit-identical (hash-checked). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * Explicit solver: trusses, point masses, springs and dashpots on the node-major layout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * docs: fem.md on trusses and discrete elements in the layout; regenerate features.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm * docs: trusses in plane models and corotational explicit trusses Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm --------- Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
53 files changed
+3626
-110
No files matched your search
+23
-2
@@ -8,7 +8,8 @@
|
||||
//! - named sets ([`sets`]) defined by geometry names or explicit labels, resolved to nodes,
|
||||
//! elements and element faces against the current mesh, so they survive remeshing;
|
||||
//! - materials and the unit system ([`materials`], [`units`]), sections with their element
|
||||
//! formulation ([`sections`]), reference points and couplings ([`constraints`]);
|
||||
//! formulation ([`sections`]), reference points and couplings ([`constraints`]), point masses,
|
||||
//! springs and dashpots ([`discrete`]);
|
||||
//! - boundary conditions ([`bcs`]), loads ([`loads`]) and steps with an explicit table of which
|
||||
//! boundary conditions and loads are active in each step ([`steps`]);
|
||||
//! - the check that names every missing or bad item, and the resolved view the deck writers and
|
||||
@@ -33,6 +34,7 @@
|
||||
pub mod bcs;
|
||||
pub mod check;
|
||||
pub mod constraints;
|
||||
pub mod discrete;
|
||||
pub mod fluids;
|
||||
pub mod geometry;
|
||||
pub mod loads;
|
||||
@@ -51,6 +53,7 @@ use serde::{Deserialize, Serialize};
|
||||
pub use bcs::{BoundaryCondition, Dofs, Symmetry, Target};
|
||||
pub use check::{Diagnostic, Resolved, ResolvedSet, Severity};
|
||||
pub use constraints::{Coupling, CouplingKind, ReferencePoint};
|
||||
pub use discrete::{Direction, Mass, PointMass, ResolvedDirection, ResolvedMass, ResolvedSpring, Spring};
|
||||
pub use fluids::{BoxFace, BoxFaces, FaceCondition, FluidBoundary, FluidDomain, Profile, SurfaceBoundary, SurfaceCondition};
|
||||
pub use geometry::{Classification, Entity, GeometryRef};
|
||||
pub use loads::{Distribution, Load, centrifugal_acceleration};
|
||||
@@ -113,6 +116,10 @@ pub struct Model {
|
||||
sections: BTreeMap<String, Section>,
|
||||
reference_points: BTreeMap<String, ReferencePoint>,
|
||||
couplings: BTreeMap<String, Coupling>,
|
||||
#[serde(skip_serializing_if = "BTreeMap::is_empty")]
|
||||
masses: BTreeMap<String, PointMass>,
|
||||
#[serde(skip_serializing_if = "BTreeMap::is_empty")]
|
||||
springs: BTreeMap<String, Spring>,
|
||||
boundary_conditions: BTreeMap<String, BoundaryCondition>,
|
||||
loads: BTreeMap<String, Load>,
|
||||
#[serde(skip_serializing_if = "BTreeMap::is_empty")]
|
||||
@@ -144,6 +151,10 @@ struct ModelData {
|
||||
#[serde(default)]
|
||||
couplings: BTreeMap<String, Coupling>,
|
||||
#[serde(default)]
|
||||
masses: BTreeMap<String, PointMass>,
|
||||
#[serde(default)]
|
||||
springs: BTreeMap<String, Spring>,
|
||||
#[serde(default)]
|
||||
boundary_conditions: BTreeMap<String, BoundaryCondition>,
|
||||
#[serde(default)]
|
||||
loads: BTreeMap<String, Load>,
|
||||
@@ -198,6 +209,12 @@ impl TryFrom<ModelData> for Model {
|
||||
for (n, v) in d.couplings {
|
||||
m.add_coupling(&n, v)?;
|
||||
}
|
||||
for (n, v) in d.masses {
|
||||
m.add_mass(&n, v)?;
|
||||
}
|
||||
for (n, v) in d.springs {
|
||||
m.add_spring(&n, v)?;
|
||||
}
|
||||
for (n, v) in d.boundary_conditions {
|
||||
m.add_boundary_condition(&n, v)?;
|
||||
}
|
||||
@@ -307,6 +324,8 @@ impl Model {
|
||||
sections: self.sections.clone(),
|
||||
reference_points: self.reference_points.clone(),
|
||||
couplings: self.couplings.clone(),
|
||||
masses: self.masses.clone(),
|
||||
springs: self.springs.clone(),
|
||||
boundary_conditions: self.boundary_conditions.clone(),
|
||||
loads: self.loads.clone(),
|
||||
fluid_domains: self.fluid_domains.clone(),
|
||||
@@ -315,13 +334,15 @@ impl Model {
|
||||
}
|
||||
|
||||
/// Counts of each kind of definition, for summaries.
|
||||
pub fn definition_counts(&self) -> [(&'static str, usize); 9] {
|
||||
pub fn definition_counts(&self) -> [(&'static str, usize); 11] {
|
||||
[
|
||||
("sets", self.sets.len()),
|
||||
("materials", self.materials.len()),
|
||||
("sections", self.sections.len()),
|
||||
("reference_points", self.reference_points.len()),
|
||||
("couplings", self.couplings.len()),
|
||||
("masses", self.masses.len()),
|
||||
("springs", self.springs.len()),
|
||||
("boundary_conditions", self.boundary_conditions.len()),
|
||||
("loads", self.loads.len()),
|
||||
("fluid_domains", self.fluid_domains.len()),
|
||||
|
||||
Reference in new issue
Block a user