forked from 1b-agent/fieldcraft-upstream
Model: datum points, drawn as a small cross; each definition's users are public
Datum::Point joins planes and axes (checked like them, refused by partitions with the kind named). The users each remove_* refuses with (sets, materials, boundary conditions, loads, reference points, fluid domains, datums) are public functions, so a caller can list them before deleting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo
This commit is contained in:
1 parent
c1fd58c6ce
commit
0bf150633c
9 files changed
+104
-30
No files matched your search
@@ -95,6 +95,12 @@ impl Model {
|
||||
}
|
||||
|
||||
pub fn remove_reference_point(&mut self, name: &str) -> Result<()> {
|
||||
not_in_use("reference point", name, self.reference_point_users(name))?;
|
||||
remove_existing(&mut self.reference_points, "reference point", name).map(|_| ())
|
||||
}
|
||||
|
||||
/// The definitions that refer to a reference point, as `kind \`name\`` strings.
|
||||
pub fn reference_point_users(&self, name: &str) -> Vec<String> {
|
||||
let mut users: Vec<String> =
|
||||
self.couplings.iter().filter(|(_, c)| c.reference_point == name).map(|(n, _)| format!("coupling `{n}`")).collect();
|
||||
users.extend(
|
||||
@@ -105,8 +111,7 @@ impl Model {
|
||||
);
|
||||
users.extend(self.loads.iter().filter(|(_, l)| l.reference_point() == Some(name)).map(|(n, _)| format!("load `{n}`")));
|
||||
users.extend(self.discrete_users(|t| t.reference_point() == Some(name)));
|
||||
not_in_use("reference point", name, users)?;
|
||||
remove_existing(&mut self.reference_points, "reference point", name).map(|_| ())
|
||||
users
|
||||
}
|
||||
|
||||
/// The node label of each reference point in decks.
|
||||
|
||||
Reference in new issue
Block a user