idwarp icon indicating copy to clipboard operation
idwarp copied to clipboard

Unable to deform using "specifiedSurfaces"

Open sreekar2858 opened this issue 2 years ago • 6 comments

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 #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:

sreekar2858 avatar Aug 17 '23 12:08 sreekar2858

To add to this I tried to just move 1 node to check how it works. The mesh is not warping at all, the deformed node just pierced into neighboring cells just as here: https://github.com/mdolab/idwarp/issues/80#issuecomment-1614412960

Thank you for the help -Sree

sreekar2858 avatar Aug 18 '23 11:08 sreekar2858

Hi @sreekar2858 ,

I know its been a year since this post. I am having the same issue. The idwarp is reading all the mesh nodes instead of reading only the mesh nodes specified by the "specifiedSurfaces". Did you solve this issue?

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 22.04.5 LTS (Jammy) Python: 3.10.12 OpenMPI: 4.1.6 CGNS: 4.4.0 PETSc: 3.19.6 OpenFoam: Foundation version 10 Compiler: This repository:

@friedenhe @sseraj @bernardopacini Did you guys look into this bug yet ? Any help would be appreciated.

BilalAnwar165 avatar Oct 11 '24 09:10 BilalAnwar165

This issue is till open. I have tried the AhmedBodyCoarse Mesh using OpenFoam10 with IDWarp. The IDwarp mesh.getSurfaceCoordinates extract the coordinates of all the surfaces even if I specify a surface in the meshOptions. Why It is happening or is there any other way to specify surface with openfoam meshes?

This does not happen with CGNS meshes.

@eirikurj @sseraj @jrram @ewu63 @JustinSGray

BilalAnwar165 avatar Oct 18 '24 09:10 BilalAnwar165

@BilalAnwar165 please do not randomly tag people, some of whom do not work on the project. This is spam will in no way get your issue resolved any faster.

As with any open source software, there is no promise that maintainers will address any issues opened. Just wait patiently and if nobody responds, then nobody responds. Bumping issues and tagging an increasing group of people you suspect have worked on the software is not a recipe for receiving free help for a free software in the future.

ewu63 avatar Oct 18 '24 14:10 ewu63

Hi @sreekar2858 ,

I know its been a year since this post. I am having the same issue. The idwarp is reading all the mesh nodes instead of reading only the mesh nodes specified by the "specifiedSurfaces". Did you solve this issue?

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 22.04.5 LTS (Jammy) Python: 3.10.12 OpenMPI: 4.1.6 CGNS: 4.4.0 PETSc: 3.19.6 OpenFoam: Foundation version 10 Compiler: This repository:

@friedenhe @sseraj @bernardopacini Did you guys look into this bug yet ? Any help would be appreciated.

Hey No, I couldn't find a fix to this issue. I stopped using IDWarp due to its limitations.

sreekar2858 avatar Oct 18 '24 16:10 sreekar2858

Thank you @sreekar2858 for your reply.

Can you suggest any other volume mesh deformer?l that can deform an unstructured mesh with inflation later?

BilalAnwar165 avatar Oct 19 '24 14:10 BilalAnwar165