Added balancing support
@@ -47,6 +47,9 @@ class NonLinearDynamicCoupledStep(BaseSolver):
self.settings_types['gravity_on'] = 'bool'
self.settings_default['gravity_on'] = False
+ self.settings_types['balancing'] = 'bool'
+ self.settings_default['balancing'] = False
+
self.settings_types['gravity'] = 'float'
self.settings_default['gravity'] = 9.81
@@ -73,6 +76,7 @@ class NonLinearDynamicCoupledStep(BaseSolver):
self.data.ts,
structural_step,
dt=dt)
+ self.extract_resultants(structural_step)
return self.data
def add_step(self):
@@ -81,18 +85,23 @@ class NonLinearDynamicCoupledStep(BaseSolver):
def next_step(self):
pass
- def extract_resultants(self):
- applied_forces = self.data.structure.nodal_b_for_2_a_for(self.data.structure.timestep_info[-1].steady_applied_forces,
- self.data.structure.timestep_info[-1])
+ def extract_resultants(self, step=None):
+ if step is None:
+ step = self.data.structure.timestep_info[-1]
+ applied_forces = self.data.structure.nodal_b_for_2_a_for(step.steady_applied_forces,
+ step)
applied_forces_copy = applied_forces.copy()
+ gravity_forces_copy = step.gravity_forces.copy()
for i_node in range(self.data.structure.num_node):
- applied_forces_copy[i_node, 3:6] += np.cross(self.data.structure.timestep_info[-1].pos[i_node, :],
+ applied_forces_copy[i_node, 3:6] += np.cross(step.pos[i_node, :],
applied_forces_copy[i_node, 0:3])
+ gravity_forces_copy[i_node, 3:6] += np.cross(step.pos[i_node, :],
+ gravity_forces_copy[i_node, 0:3])
- totals = np.sum(applied_forces_copy, axis=0) + self.data.structure.timestep_info[-1].total_gravity_forces
# print("applied forces dynamic= ", np.sum(applied_forces_copy, axis=0))
# print("Unsteady totals = ", totals)
+ totals = np.sum(applied_forces_copy + gravity_forces_copy, axis=0)
return totals[0:3], totals[3:6]
# def extract_resultants(self, tstep):
