Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions src/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(self, params=None):
@classmethod
def from_parameters(cls, params: Dict[str, Any]) -> 'Configuration':
"""Create and fully initialize Configuration from parameter dictionary."""
#print("Initializing vessel configuration...")
cls._validate_parameters(params)

config = cls(params)
Expand All @@ -31,13 +30,12 @@ def from_parameters(cls, params: Dict[str, Any]) -> 'Configuration':
layer = Layer.from_parameters(layer_data)
config.add_layer(layer)

# Compute homeostatic stress (direct method - no simulation params needed)
# TODO: integrate this into Layer.from_parameters.
#print("\nComputing homeostatic stresses...")
for layer in config.layers:
layer.compute_homeostatic_stress_direct()

#print(f"\nConfiguration initialized with {len(config.layers)} layers")

config.print_state()

return config

@staticmethod
Expand Down Expand Up @@ -316,3 +314,28 @@ def write_timestep_data(self, io_handler: 'IOHandler', timestep: int, time: floa
const_data,
layer_name=layer.name
)

# =========================================================================
# OUTPUT: PRINTING
# =========================================================================

def print_state(self, timestep: int = None):
"""Print configuration state.

Prints state of all layers and their constituents at specified timestep.

Args:
timestep: Timestep to print data from. If None, prints homeostatic state.

Examples:
config.print_state() # Homeostatic state
config.print_state(timestep=10) # At timestep 10
"""
if timestep is None:
self.logger.section("HOMEOSTATIC CONFIGURATION", log_level='INFO')
else:
self.logger.section(f"CONFIGURATION AT TIMESTEP {timestep}", log_level='INFO')

# Print each layer
for layer in self.layers:
layer.print_state(timestep=timestep, logger=self.logger)
209 changes: 161 additions & 48 deletions src/constituent.py

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/constitutive_laws.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ def set_fiber_orientation(self, angle_degrees):

# Store as unit vector
self.fiber_orientation = a0 / np.linalg.norm(a0)

print(f" Fiber orientation: {angle_degrees}° → "
f"a0 = [{a0[0]:.3f}, {a0[1]:.3f}, {a0[2]:.3f}]")

def is_isotropic(self):
"""Check if material is isotropic."""
Expand Down
Loading
Loading