Skip to content

Inverted cells due to mirroring transformation #1007

@waltersma

Description

@waltersma

Hi @waltersma,
if I run the example from above with a matrix for mirroring, I get negative volumes. Here is my code part:

#...
# transform copy in x-direction to be adjacent to original
transform = [
    1, 0, 0, 0.032,
    0, -1, 0, 0,
    0, 0, 1, 0,
    0, 0, 0, 1, 
]
transform_params = prime.TransformParams(model, transform)
prime.Transform(model).transform_zonelets(part.id, copied_cell_zonelets, transform_params)

# use a beta api to merge nodes and connect the two meshes
merge_params = prime.MergeBoundaryNodesParams(
    model,
    merge_node_type=prime.MergeNodeType.ALLALL,
    tolerance=0.0001,
    use_absolute_tolerance=True,
)
result = prime.Connect(model).merge_boundary_nodes(part.id, face_zonelets, copied_face_zonelets, merge_params)

# write as a fluent mesh file
mesh_util.write(file_name="hex.msh")

vtool = prime.VolumeMeshTool(model=model)
result = vtool.check_mesh(part_id=part.id, params=prime.CheckMeshParams(model=model))

print("Non positive volumes:", result.has_non_positive_volumes)
print("Non positive areas:", result.has_non_positive_areas)
print("Invalid shape:", result.has_invalid_shape)
print("Left handed faces:", result.has_left_handed_faces)

Output:

Non positive volumes: True
Non positive areas: False
Invalid shape: False
Left handed faces: True

This is an issue, right? I used the version 0.7.0.

Best regards, Susanne

Originally posted by @susannehaase in #915 (reply in thread)

Metadata

Metadata

Assignees

No one assigned

    Labels

    apsAnything related to Ansys Prime ServerbugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions