Skip to content

Tom.abaqusinputgenerator#4

Merged
matthiasneuner merged 13 commits intomasterfrom
tom.abaqusinputgenerator
Nov 13, 2025
Merged

Tom.abaqusinputgenerator#4
matthiasneuner merged 13 commits intomasterfrom
tom.abaqusinputgenerator

Conversation

@maderthomas
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds Abaqus input file generator support and related functionality for the EdelweissMPM framework. The changes introduce new test examples and enhance particle constraint handling capabilities.

  • Implements Abaqus input file parsing and mesh generation from .inp files
  • Adds support for setting initial conditions on Marmot particles (e.g., geostatic stress)
  • Enhances vertex-based Dirichlet boundary conditions with support for multiple vertices per particle

Reviewed Changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
examples/127_marmot_consistent_weak_formulation_test/marmot_consistent_weak_formulation.py New test for consistent weak formulation with CWF correction loads
examples/126_set_lagrangian_on_vertices_test/set_lagrangian_on_vertices.py New test for setting Lagrangian constraints on particle vertices
examples/125_marmot_set_initial_condition_test/marmot_set_initial_condition.py New test demonstrating initial condition setting (geostatic stress)
examples/124_abq_input_reader_test/abq_input_reader.py New test for Abaqus input file reader with potato mesh example
edelweissmpm/particles/marmot/marmotparticlewrapper.pyx Implements setInitialCondition method for particle state initialization
edelweissmpm/particles/marmot/marmotparticlewrapper.pxd Adds C++ setInitialCondition method declaration
edelweissmpm/models/mpmmodel.py Adds vertexSets collection to model for vertex-based operations
edelweissmpm/constraints/particlelagrangianweakdirichlet.py Enhances factory to support multiple vertex IDs per constraint

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

def run_sim():
dimension = 2

# set nump linewidth to 200:
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "nump" appears to be a typo for "numpy". This should be corrected to "numpy" for clarity.

Suggested change
# set nump linewidth to 200:
# set numpy linewidth to 200:

Copilot uses AI. Check for mistakes.
def run_sim():
dimension = 2

# set nump linewidth to 200:
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "nump" appears to be a typo for "numpy". This should be corrected to "numpy" for clarity.

Suggested change
# set nump linewidth to 200:
# set numpy linewidth to 200:

Copilot uses AI. Check for mistakes.
def run_sim():
dimension = 2

# set nump linewidth to 200:
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "nump" appears to be a typo for "numpy". This should be corrected to "numpy" for clarity.

Suggested change
# set nump linewidth to 200:
# set numpy linewidth to 200:

Copilot uses AI. Check for mistakes.
):
dimension = 2

# set nump linewidth to 200:
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment "nump" appears to be a typo for "numpy". This should be corrected to "numpy" for clarity.

Suggested change
# set nump linewidth to 200:
# set numpy linewidth to 200:

Copilot uses AI. Check for mistakes.
Comment on lines +151 to +158
# if reading_surfaces:
# parts = [p.strip() for p in line.split(',') if p.strip()]
# surface_elSet = parts[0]
# surface_orientation = int(parts[1][-1])
# if current_surface not in surfaces.keys():
# surfaces[current_surface] = {surface_elSet: surface_orientation}
# else:
# surfaces[current_surface][surface_elSet] = surface_orientation
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Suggested change
# if reading_surfaces:
# parts = [p.strip() for p in line.split(',') if p.strip()]
# surface_elSet = parts[0]
# surface_orientation = int(parts[1][-1])
# if current_surface not in surfaces.keys():
# surfaces[current_surface] = {surface_elSet: surface_orientation}
# else:
# surfaces[current_surface][surface_elSet] = surface_orientation

Copilot uses AI. Check for mistakes.
Comment on lines +285 to +293
# for surfaceName, surfaceData in surfaces.items():
# modelSurfaceName = f"{name}_{surfaceName}"
# for elsetName, orientation in surfaceData.items():
# print(surfaceName, elsetName, orientation)
# if modelSurfaceName not in model.surfaces.keys():
# model.surfaces[f"{name}_{surfaceName}"] = {orientation: [particles[e-1] for e in elsets[elsetName]]}
# else:
# model.surfaces[f"{name}_{surfaceName}"][orientation] = [particles[e-1] for e in elsets[elsetName]]

Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Suggested change
# for surfaceName, surfaceData in surfaces.items():
# modelSurfaceName = f"{name}_{surfaceName}"
# for elsetName, orientation in surfaceData.items():
# print(surfaceName, elsetName, orientation)
# if modelSurfaceName not in model.surfaces.keys():
# model.surfaces[f"{name}_{surfaceName}"] = {orientation: [particles[e-1] for e in elsets[elsetName]]}
# else:
# model.surfaces[f"{name}_{surfaceName}"][orientation] = [particles[e-1] for e in elsets[elsetName]]

Copilot uses AI. Check for mistakes.
Comment on lines +346 to +353
# for f in theModel.meshfreeKernelFunctions.values():
# boundingBox = f.getBoundingBox()
# boundingBoxMin = boundingBox[0]
# boundingBoxMax = boundingBox[1]
# width = boundingBoxMax[0] - boundingBoxMin[0]
# height = boundingBoxMax[1] - boundingBoxMin[1]
# #plt.plot(boundingBoxMin[0], boundingBoxMin[1], 'ro', markersize=1)
# plt.gca().add_patch(plt.Rectangle(boundingBoxMin, width, height, linestyle='-', linewidth=1, edgecolor='r', facecolor='none'))
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Suggested change
# for f in theModel.meshfreeKernelFunctions.values():
# boundingBox = f.getBoundingBox()
# boundingBoxMin = boundingBox[0]
# boundingBoxMax = boundingBox[1]
# width = boundingBoxMax[0] - boundingBoxMin[0]
# height = boundingBoxMax[1] - boundingBoxMin[1]
# #plt.plot(boundingBoxMin[0], boundingBoxMin[1], 'ro', markersize=1)
# plt.gca().add_patch(plt.Rectangle(boundingBoxMin, width, height, linestyle='-', linewidth=1, edgecolor='r', facecolor='none'))

Copilot uses AI. Check for mistakes.
Comment on lines +383 to +389
# for surfaceName, surfaceData in theModel.surfaces.items():
# for orientation, particles in surfaceData.items():
# #print(surfaceName, orientation, len(particles))
# for p in particles:
# verts = p.getVertexCoordinates()
# plt.plot(verts[:, 0], verts[:, 1], linestyle='-', linewidth=2, color='b')

Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appears to contain commented-out code.

Suggested change
# for surfaceName, surfaceData in theModel.surfaces.items():
# for orientation, particles in surfaceData.items():
# #print(surfaceName, orientation, len(particles))
# for p in particles:
# verts = p.getVertexCoordinates()
# plt.plot(verts[:, 0], verts[:, 1], linestyle='-', linewidth=2, color='b')

Copilot uses AI. Check for mistakes.
reading_surfaces = True
current_nset = None
current_elset = None
current_surface = line.split("name=")[1].split(",")[0].strip() if "=" in line else "default"
Copy link

Copilot AI Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable current_surface is not used.

Suggested change
current_surface = line.split("name=")[1].split(",")[0].strip() if "=" in line else "default"

Copilot uses AI. Check for mistakes.
@matthiasneuner matthiasneuner merged commit 4daa031 into master Nov 13, 2025
8 of 10 checks passed
@matthiasneuner matthiasneuner deleted the tom.abaqusinputgenerator branch November 15, 2025 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants