Skip to content

Commit ca54696

Browse files
thomasthomas
authored andcommitted
resolve merge conflicts and adjust examples
1 parent 1e22e19 commit ca54696

File tree

16 files changed

+1423
-1542
lines changed

16 files changed

+1423
-1542
lines changed

edelweissmpm/constraints/particlelagrangianweakdirichlet.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _getConstraintLocation():
5959
elif location == "vertex":
6060
if vertexID is None:
6161
raise ValueError("vertexID must be specified when location is 'vertex'.")
62-
constraintLocation = particle.getVertexCoordinates(vertexID)
62+
constraintLocation = particle.getVertexCoordinates()[vertexID]
6363
return constraintLocation
6464

6565
self._getConstraintLocation = _getConstraintLocation
@@ -181,15 +181,15 @@ def ParticleLagrangianWeakDirichletOnParticleSetFactory(
181181
constraints = dict()
182182
for i, p in enumerate(particleSet):
183183
if location == "vertex":
184-
if isinstance(vertexID, int):
185-
name = f"{baseName}_{i}_v{vertexID}"
186-
constraint = ParticleLagrangianWeakDirichlet( name, p, field, prescribedStepDelta, model, location, faceID, vertexID)
187-
constraints[name] = constraint
188-
else:
184+
if isinstance(vertexID, list):
189185
for vertIdx in vertexID:
190186
name = f"{baseName}_{i}_v{vertIdx}"
191187
constraint = ParticleLagrangianWeakDirichlet( name, p, field, prescribedStepDelta, model, location, faceID, vertIdx)
192188
constraints[name] = constraint
189+
else:
190+
name = f"{baseName}_{i}_v{vertexID}"
191+
constraint = ParticleLagrangianWeakDirichlet( name, p, field, prescribedStepDelta, model, location, faceID, vertexID)
192+
constraints[name] = constraint
193193
else:
194194
name = f"{baseName}_{i}"
195195
constraint = ParticleLagrangianWeakDirichlet( name, p, field, prescribedStepDelta, model, location, faceID, vertexID)

0 commit comments

Comments
 (0)