Skip to content

Unable to deform using "specifiedSurfaces" #85

@sreekar2858

Description

@sreekar2858

Description

Hello
I am using OpenFOAM case to morph a face using IDWarp.
The geometry is a cuboid as the following picture. The specifiedSurfaces are marked in red.
image

I defined the python script as follows:

import os
from mpi4py import MPI
from idwarp import USMesh
from pyofm import *
import numpy as np

options = {
  'gridFile':os.getcwd(),
  'fileType':'OpenFOAM',
  'specifiedSurfaces':["inner_walls"],
  'symmetrySurfaces':[],
  'symmetryPlanes':[],
  'aExp': 3.0,
  'bExp': 5.0,
  'LdefFact':1.0,
  'alpha':0.25,
  'errTol':0.000001,
  'evalMode':'fast',
  'useRotations':True,
  # 'zeroCornerRotations':True,
  'cornerAngle':30.0,
  'bucketSize':8,
}

# Create the mesh object
mesh = USMesh(options=options, comm=MPI.COMM_WORLD)

# Extract all coordinates
coords0 = mesh.getSurfaceCoordinates()

# Modify the coordinates as required
newCoords = coords0.copy()

for i in range(0,coords0.shape[0]):
    newCoords[i, 2] += 0.005

print(newCoords.shape)

# Reset the newly computed surface coordinates
mesh.setSurfaceCoordinates(newCoords)

mesh.getCommonGrid()

# Actually run the mesh warping
mesh.warpMesh()

# Write the new grid file.
mesh.writeGrid()

When I tried to check what "getSurfaceCoordinates" returns, I noticed it output 6272 points but the specifiedSurfaces should have 355 points and the entire geometry has 3190 points. I don't understand where the other points are from.
I exported the output from getSurfaceCoordinates() into a txt file and plotted in paraview which is perfectly coinciding with the existing mesh. So, it is returning all the points in the mesh with some additional points.

I would like to just morph the coordinates of a surface and want the entire mesh to conform to that change.

Steps to reproduce issue

  1. IDWarp 2.6.1 with fix from fix writeVolumeMeshPoints #84. This is optional as I would like to understand what the function getSurfaceCoordinates() returns and in what order.
  2. Here is the test case I am working on
    Test_Geom_01_solid.zip

Current behavior

The function is returning all the mesh points in the geometry with some redundant points.

Expected behavior

It should only return the points from specifiedSurfaces input in options.

Code versions

  • Operating System: UBUNTU 20.04.5 LTS (Focal Fossa)
  • Python: 3.8.10
  • OpenMPI: 3.1.6
  • CGNS: 4.1.2
  • PETSc: 3.14.6
  • Compiler:
  • This repository:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions