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
@@ -232,10 +232,14 @@ impl Model {
|
||||
replace_existing(&mut self.boundary_conditions, "boundary condition", name, bc)
|
||||
}
|
||||
|
||||
/// The steps that list a boundary condition, as `step \`name\`` strings.
|
||||
pub fn boundary_condition_users(&self, name: &str) -> Vec<String> {
|
||||
self.steps.iter().filter(|s| s.boundary_conditions.contains(name)).map(|s| format!("step `{}`", s.name)).collect()
|
||||
}
|
||||
|
||||
/// Remove a boundary condition that no step lists.
|
||||
pub fn remove_boundary_condition(&mut self, name: &str) -> Result<()> {
|
||||
let users = self.steps.iter().filter(|s| s.boundary_conditions.contains(name)).map(|s| format!("step `{}`", s.name)).collect();
|
||||
not_in_use("boundary condition", name, users)?;
|
||||
not_in_use("boundary condition", name, self.boundary_condition_users(name))?;
|
||||
remove_existing(&mut self.boundary_conditions, "boundary condition", name).map(|_| ())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user