Coder Social home page Coder Social logo

idwarp's Introduction

IDWarp

Build Status Documentation Status codecov

IDWarp uses an inverse distance method to modify the location of mesh volume nodes given a perturbation of the surface nodes.

Documentation

Please see the documentation for installation details and API documentation.

To locally build the documentation, enter the doc folder and enter make html in terminal. You can then view the built documentation in the _build folder.

Citation

If you use IDWarp in any publication for which you find it useful, please cite this paper.

N. Secco, G. K. W. Kenway, P. He, C. A. Mader, and J. R. R. A. Martins, “Efficient Mesh Generation and Deformation for Aerodynamic Shape Optimization”, AIAA Journal, 2021. doi:10.2514/1.J059491

@article{Secco2021,
    title = {Efficient Mesh Generation and Deformation for Aerodynamic Shape Optimization},
    author = {Ney Secco and Gaetan K. W. Kenway and Ping He and Charles A. Mader and Joaquim R. R. A. Martins},
    doi = {10.2514/1.J059491},
    journal = {AIAA Journal},
    year = {2021}
}

License

Copyright 2019 MDO Lab. See the LICENSE file for details.

idwarp's People

Contributors

a-cgray avatar anilyil avatar bbrelje avatar bernardopacini avatar camader avatar eirikurj avatar ewu63 avatar eytanadler avatar friedenhe avatar gawng avatar gkenway avatar hajdik avatar johnjasa avatar jrram avatar justinsgray avatar marcomangano avatar mtowara avatar nbons avatar neysecco avatar sseraj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

idwarp's Issues

"Symbol ‘null’ at (1) has no IMPLICIT type" when compiling

Hello everyone, when I compile idwarp, I met a error that says as follows. Does anyone know how to fix this? Thank you very much!

readUnstructuredCGNS.F90:185:85:
  185 |                                             zones(iZone)%sections(sec)%elemConn, NULL, ierr)
      |                                                                                     1
Error: Symbol ‘null’ at (1) has no IMPLICIT type; did you mean ‘cg_null’?
make[3]: *** [../..//Rules.mk:2: readUnstructuredCGNS.o] Error 1

Steps to reproduce issue

Current behavior

Expected behavior

Code versions

  • Operating System: ubuntu
  • Python:
  • OpenMPI:
  • CGNS: stable version
  • PETSc:
  • Compiler: gfortran
  • This repository:

Rename the compiled `.so` libraries

Type of issue

What types of issue is it?
Select the appropriate type(s) that describe this issue

  • Maintenance

Description

In order to reduce confusion with the Python package, we should rename the compiled libraries by appending lib in front. This is consistent with the other repositories, such as ADflow.

  • idwarp.so -> libidwarp.so
  • idwarp_cs.so -> libidwarp_cs.so

In the current situation, when typing import idwarp it is unclear if we mean the compiled module, or the Python package.

Both the Python script and the Makefiles need to be updated for this to work properly.

Complex tests generate complex reference values

Description

Due to the build bot failure last night, we realized that some tests are generating complex values while the reference file contains only the real part. We should fix the tests so that the values we compare are real and not complex.

For IDWarp the following tests are impacted:

test_MultiUSMesh.py:Test_MultiUSMesh_2_complex.test_onera_m6
test_MultiUSMesh.py:Test_MultiUSMesh_3_parallel_complex.test_onera_m6
test_USMesh.py:Test_USmesh_2_complex.test_omesh
test_USMesh.py:Test_USmesh_2_complex.test_sym_mesh
test_USMesh.py:Test_USmesh_3_parallel_complex.test_omesh
test_USMesh.py:Test_USmesh_3_parallel_complex.test_sym_mesh

Steps to reproduce issue

  1. Run test_USMesh.py:Test_USmesh_2_complex.test_omesh
  2. Look at the value generated for Test_o_mesh - Sum of vCoords Warped

Current behavior

Value is complex

Expected behavior

Value should be real

Unable to deform using "specifiedSurfaces"

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:

CGNS format to read in readUnstructuredCGNS.F90 is deprecated

Description

Hello

I have been trying to morph a mesh with OpenFOAM grid but there is a bug with writing grid. I found a fix but the mesh is not morphing but rather just transforming the specified nodal positions.
Since, IDWarp has more examples using CGNS I tried using that file format but found that readUnstructuredCGNS can only input ADF format and with ElementList instead of pointList for BC which is deprecated (https://cgns.github.io/CGNS_docs_current/midlevel/bc.html).
image
image

Can I ask what software you used to export cgns, so, I can replicate the workflow?

Can't compile with '-std=f2008'

Description

I am trying to update my local install. But i can't compile when i use the default compiler flag '-std=f2008'. If i remove it, it works.

Steps to reproduce issue

  1. Try compiling it with the default 'config.LINUX_GFORTRAN_OPENMPI.mk'

Current behavior

I get this error:

...
make[3]: Entering directory '/home/andv/Downloads/MACH/idwarp/src/modules'
../..//Rules.mk:20: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:20: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:14: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:14: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:14: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:14: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:8: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:8: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:2: warning: ignoring prerequisites on suffix rule definition
../..//Rules.mk:2: warning: ignoring prerequisites on suffix rule definition
mpifort -I../..//mod -I/home/andv/.mamba/envs/MACH/external/cgns/include -I/home/andv/.mamba/envs/MACH/external/hdf5/include -fPIC -fdefault-real-8 -O2 -std=f2008 -I/home/andv/.mamba/envs/MACH/external/petsc/include -I/home/andv/.mamba/envs/MACH/external/petsc/ -c gridData.F90 -o ../..//obj/gridData.o
gridData.F90:11:6:

   11 |   use petsc
      |      1
Error: GNU Extension: Variable ‘petsc_comm_world’ at (1) is in COMMON but only in BLOCK DATA initialization is allowed
gridData.F90:11:6:

   11 |   use petsc
      |      1
Error: GNU Extension: Variable ‘petsc_comm_self’ at (1) is in COMMON but only in BLOCK DATA initialization is allowed
make[3]: *** [../..//Rules.mk:2: gridData.o] Error 1
make[3]: Leaving directory '/home/andv/Downloads/MACH/idwarp/src/modules'
make[2]: *** [Makefile:49: all] Error 2
make[2]: Leaving directory '/home/andv/Downloads/MACH/idwarp/src/modules'
make[1]: *** [Makefile:55: warp] Error 1
make[1]: Leaving directory '/home/andv/Downloads/MACH/idwarp'
make: *** [Makefile:24: default] Error 2

Expected behavior

It should compile with default flags.

Code versions

  • Operating System: linux
  • Python: 3.9
  • OpenMPI: 4.1.2
  • CGNS: 4.2
  • PETSc: 3.15
  • This software:

Convert tests to use testflo

Description

I'm not sure if anyone's done this already -- the old spreadsheet doesn't have anything and I didn't see it in anyone's forks. But someone needs to update tests to use the testflo framework with BaseRegTest.

Small Bugs in making idwarp_cs

src_cs/f2py/Makefile
In this file, there is no commands to generate ".f2py_f2cmap"
However, in the end, it comes with "rm .f2py_f2cmap"
Anything missing in the Makefile? Or it is just unnecessary.

Error: idwarp was not imported correctly

Description

Calling import libidwarp ends with following error:

<python-input-1-9208cb37fd3f> in <module>
----> 1 import libidwarp

ImportError: /home/user/dafoam/repos/idwarp/src/f2py/libidwarp.so: undefined symbol: __cgns_MOD_bctypename

Steps to reproduce issue

  1. follow instructions how to build dafoam from source: https://dafoam.github.io/mydoc_installation_source.html

  2. cd $HOME/dafoam/repos &&
    wget https://github.com/mdolab/idwarp/archive/v2.6.0.tar.gz -O idwarp.tar.gz &&
    tar -xvf idwarp.tar.gz && cd idwarp-2.6.0 &&
    cp -r config/defaults/config.LINUX_GFORTRAN_OPENMPI.mk config/config.mk &&
    make && pip install . && \

  3. the make fails with following error: python importTest.py
    Testing if module libidwarp can be imported...
    Error: idwarp was not imported correctly
    make: *** [Makefile:42: all] Error 1

  4. go to ~/dafoam/repos/idwarp-2.6.0/src/f2py

  5. run python and import libidwarp

Current behavior

The build fails on my system

Expected behavior

The build works

Code versions

  • Operating System: Debian 10.2.1-6
  • Python: 3.8.10
  • OpenMPI:3.1.6
  • CGNS:4.1.2
  • PETSc:3.14.6
  • Compiler:gcc version 9.3.0
  • This repository: idwarp-2.6.0

installation error

Hi, I met some problem when compile. Could someone give me some advice? Thank you!

make[3]: Entering directory '/home/haizhou/packages/idwarp-main/src/modules'
mpifort -I../..//mod -I/home/haizhou/packages/CGNS-4.4.0/opt-gfortran/include -fPIC -fdefault-real-8 -O2 -std=f2008 -I/home/haizhou/packages/petsc-3.20.1/include -I/home/haizhou/packages/petsc-3.20.1/real-debug/include -I/home/haizhou/packages/openmpi-5.0.0/opt-gfortran/include -I/home/haizhou/packages/petsc-3.20.1/ -c kd_tree.F90 -o ../..//obj/kd_tree.o
kd_tree.F90:1568:49:

1568 | call VecGetArrayF90(XsLocal, XsPtr, ierr)
| 1
Error: Type mismatch in argument ‘array’ at (1); passed REAL(8) to COMPLEX(8)
kd_tree.F90:1575:53:

1575 | call VecRestoreArrayF90(XsLocal, XsPtr, ierr)
| 1
Error: Type mismatch in argument ‘array’ at (1); passed REAL(8) to COMPLEX(8)
make[3]: *** [../..//Rules.mk:2: kd_tree.o] Error 1
make[3]: Leaving directory '/home/haizhou/packages/idwarp-main/src/modules'
make[2]: *** [Makefile:44: all] Error 2
make[2]: Leaving directory '/home/haizhou/packages/idwarp-main/src/modules'
make[1]: *** [Makefile:55: warp] Error 1
make[1]: Leaving directory '/home/haizhou/packages/idwarp-main'
make: *** [Makefile:24: default] Error 2

problem installing idwarp

I am trying to install idwarp, I am using the same packages that I used to install adflow successfully (?) (need idwarp to run the complete tests) and pyspline (same CGNS paths etc...).
The problem seems to occur at the end of the installation process when the 'make' tests the 'import idwarp'.

image

the problem seems to come from an: undefined symbol cg_elementdatasize_f_, which only seems to exist in binaries (so I couldn't investigate the problem further):

Binary file lib/libidwarp.a matches
Binary file obj/readUnstructuredCGNS.o matches
Binary file src/f2py/idwarp.so matches

Do you have an idea of what might be the problem?

PS: I'm on Ubuntu 18.04

Implement the aExp and bExp options

Description of feature

The aExp and bExp values are currently hard-coded in most of the Fortran code. We should complete the partial implementation to allow users to set these values in Python.

Potential solution

This will mainly involve modifying how the interpolation weights are computed in kd_tree.F90. See here for one example.

call to VecGetValues causes build error?

I am trying to compile idwarp, but running make gives me the following error:

mpif90 -I../..//mod -I/home/---/CGNS-3.3.0/opt-gfortran/include -DUSECGNSMODULE   -fPIC -fPIC -fdefault-real-8 -O2 -I/home/---/petsc-3.14.3/include -I/---/petsc-3.14.3/real-opt/include -I/---/petsc-3.14.3 -c getCommonVolumeCoordinates.F90 -o ../..//obj/getCommonVolumeCoordinates.o
getdXs.F90:19.64:

     call VecGetValues(dXs, 1,  (/i+istart-1/), output(i), ierr)
                                                                1
Error: There is no specific subroutine for the generic 'vecgetvalues' at (1)
getSurfaceCoordinates.F90:20.67:

     call VecGetValues(Xs, 1, (/iStart+i-1/), coordinates(i), ierr)
                                                                   1
Error: There is no specific subroutine for the generic 'vecgetvalues' at (1)

The error refers to this line, and one other:

call VecGetValues(dXs, 1, (/i+istart-1/), output(i), ierr)

Checking the PETSc documentation for this function suggests that there should be 4 arguments when this function is called, not 5. Could this be the source of the build error?

I am using gfortran 4.8.5 with PETSc version 3.14.3 and OpenMPI 4.1.0.

For some reason I can still successfully install the library using pip install . despite this error occurring, but then importing the library gives this warning message:

mca_base_component_repository_open: unable to open mca_op_avx: ---/openmpi-4.1.0/opt-gfortran/lib/openmpi/mca_op_avx.so: undefined symbol: ompi_op_base_module_t_class (ignored)

Make openfoammeshreader an optional dependency

Type of issue

  • Bugfix (non-breaking change which fixes an issue)

Description

Currently, the reg tests require that you have openfoammeshreader installed, but it's not listed as a dependency. Either have it be a dependency or refactor the regression tests so that it is not needed.

Steps to reproduce issue

Run the reg tests without openfoammeshreader installed.

Current behavior

The reg tests fail without that package, without a good error message

Expected behavior

Reg tests should pass

Mesh quality metrics

Type of issue

  • New feature (non-breaking change which adds functionality)

Description

If possible, it would be useful to have a way to obtain quality metrics (e.g., skewness, non-orthogonality, determinants, etc.) for the initial and warped meshes. pyWarp seems to have some, although I don't know what exactly they represent.

Two dimensional deformation getElementProps.F90

I was using idwarp for two dimensional cases.
In order to work properly I adjusted the file getElementProps.F90.
As faces are lines in two dimensions, the existing algorithm produced a division by zero.
I just added an if statement that computes the areas and normals differently
in case the number of points per face is only.

The main problem is now the differentiation of the file getElementProps.F90
with tapenade. The online conversion tool
is based on version 3.15 wich produces files that are not compatible with version 3.10
that was used to differentiate idwarp.

Do you still have access to version 3.10 of tapenade? Or do you have any other idea
as a workaround?

More information during compilation process

Description of feature

When I was compiling idwarp on Great Lakes, it was telling me it couldn't import properly at the end of the make procedure. After some help from Saja and Marco, we figured out it was because CGNS wasn't properly linked in the environment variable LD_LIBRARY_PATH but it would be nice to get printout error messages saying this was the problem from the beginning.

EDIT: This could be fixed with the new cmake/meson build

Potential solution

Change the print out in the IDwarp build process or add some simple test that makes it more obvious that something with the CGNS installation is wrong.

`inflate_cube` test appears to fail

Description

When running testflo, the fortran function verifyWarpDeriv. In the inflate_cube test, the output from this test appears to show large errors in some of the derivative terms. However, these error values are not actually used as a unit test and so the entire test suite still passes.

Given how weird the FD values are for the two terms with big errors, it may be that the issue is in those rather than the AD values, but it's hard to see how that could be the case.

As well as fixing these errors, the values computed by verifyWarpDeriv should also be used as unit tests themselves.

Steps to reproduce issue

Please provide a minimum working example (MWE) if possible

  1. Download input files
  2. Run testflo -s -n 1 --pre_announce .

Current behavior

 Welcome to verifyWarpDeriv
 Checking            5  degrees of freedom
 Doing centered differnce with h:   9.9999999999999995E-007
 Running AD Version
DOF:    0 OrigVal:   1.10000000000     AD:  3.20276945718     FD: -82.5391959690     Err(%): 216.1477878    
DOF:    1 OrigVal:   0.00000000000     AD:  1.55441018422     FD:  1.55440962639     Err(%):-0.3588677678E-04
DOF:    2 OrigVal:   0.00000000000     AD:  2.37789159693     FD:  2.37789019958     Err(%):-0.5876415306E-04
DOF:    3 OrigVal:   1.10000000000     AD:  3.24466226094     FD: -76.8269017747     Err(%):  217.6382903    
DOF:    4 OrigVal:  0.480000000000E-01 AD:  1.57707427507     FD:  1.57707371725     Err(%):-0.3537008183E-04
DOF:    5 OrigVal:   0.00000000000     AD:  2.38147538319     FD:  2.38147398580     Err(%):-0.5867736573E-04
.

Expected behavior

Errors should be ~<1e-4

Code versions

List versions only if relevant

  • Python 3.8

Restart file functionality is broken

Description of feature

IDWarp can restart from a file and skip the costly full initialization. See: https://github.com/mdolab/idwarp/blob/master/src/warp/initializeWarping.F90#L66-L76
This feature is not widely used, and it is not tested. We should include tests for this and make its usage widespread.
For most cases, people run the same meshes over and over again, and with this option, idwarp can automatically save and load restart files and speed up initialization. Possibly not huge gains but it is free so why not.

Segfault on memory deallocation

Type of issue

What types of issue is it?

  • Bugfix (non-breaking change which fixes an issue)

Description

Commit 342d98f removed the common_to_dxs VecScatterCreate function from initializeWarping.F90. However, the VecScatterDestroy destructor on line 49 of releaseMemory.F90 was not removed. PETSc therefore tries to destroy an uninitialized VecScatter object and segfaults.

Steps to reproduce issue

  1. Compile idwarp using GCC 7, PETSc 3.11, and Sandy's fork of idwarp
  2. cd idwarp/python/reg_tests
  3. python solve_script.py test2
  4. Redo with debug flags turned on and using Valgrind if desired to localize the error

Current behavior

Segfaults

Expected behavior

No segfault

Code version (if relevant)

Python version: Miniconda 3.7

**External dependencies:**Petsc 3.11

Internal packages: idwarp latest Sandy fork

Unable to write grid

Description

I have an cube OpenFOAM mesh and tried to deform top and side faces by x1.05 to test if idwarp works.
But I am getting an error at the end of the run. I am attaching the case directory with .py file for reference.
OF_idwarp.zip

Steps to reproduce issue

  1. I am using idwarp from dafoam-latest running on docker. https://dafoam.github.io/mydoc_get_started_download_docker.html

Current behavior

Python is throwing error that

 Finished Mesh Initialization.
Traceback (most recent call last):
  File "solid_warp.py", line 44, in <module>
    mesh.writeGrid()
  File "/home/dafoamuser/dafoam/packages/miniconda3/lib/python3.8/site-packages/idwarp/UnstructuredMesh.py", line 505, in writeGrid
    self._writeOpenFOAMVolumePoints(self.getCommonGrid())
AttributeError: 'USMesh' object has no attribute '_writeOpenFOAMVolumePoints'

Expected behavior

It should've changed the polyMesh in OpenFOAM directory

Code versions

  • Operating System: Ubuntu 20.04.5 LTS (Focal Fossa)
  • Python: 3.8.10
  • OpenMPI: v3.1.6
  • CGNS: 4.1.2
  • PETSc: 3.14.6
  • Compiler: Python
  • This repository: --

Build Issue, "no specific subroutine"

I'm new to using the various mdolab codes, and I'm having trouble building idwarp. During make, I hit the following error:

mpif90 -I../..//mod -I/home/garobed/packages/CGNS/opt-gfortran/include -DUSECGNSMODULE   -fPIC -fPIC -fdefault-real-8 -O2  -I/home/garobed/packages/petsc/include -I/home/garobed/packages/petsc/real-debug/include -I/home/garobed/packages/openmpi-4.1.0/opt-gfortran/include -I/home/garobed/packages/petsc/ -c getVolumeCoordinates.F90 -o ../..//obj/getVolumeCoordinates.o

        --- Compiled getElementProps.F90 successfully ---

mpif90 -I../..//mod -I/home/garobed/packages/CGNS/opt-gfortran/include -DUSECGNSMODULE   -fPIC -fPIC -fdefault-real-8 -O2  -I/home/garobed/packages/petsc/include -I/home/garobed/packages/petsc/real-debug/include -I/home/garobed/packages/openmpi-4.1.0/opt-gfortran/include -I/home/garobed/packages/petsc/ -c getCommonVolumeCoordinates.F90 -o ../..//obj/getCommonVolumeCoordinates.o
getSurfaceCoordinates.F90:20:67:

      call VecGetValues(Xs, 1, (/iStart+i-1/), coordinates(i), ierr)
                                                                   1
Error: There is no specific subroutine for the generic ‘vecgetvalues’ at (1)
getdXs.F90:19:64:

      call VecGetValues(dXs, 1,  (/i+istart-1/), output(i), ierr)
                                                                1
Error: There is no specific subroutine for the generic ‘vecgetvalues’ at (1)
../..//Rules.mk:2: recipe for target 'getdXs.o' failed
make[3]: *** [getdXs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
../..//Rules.mk:2: recipe for target 'getSurfaceCoordinates.o' failed
make[3]: *** [getSurfaceCoordinates.o] Error 1

        --- Compiled getVolumeCoordinates.F90 successfully ---


        --- Compiled getCommonVolumeCoordinates.F90 successfully ---

make[3]: Leaving directory '/home/garobed/idwarp/src/warp'
Makefile:37: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/garobed/idwarp/src/warp'
Makefile:51: recipe for target 'warp' failed
make[1]: *** [warp] Error 1
make[1]: Leaving directory '/home/garobed/idwarp'
Makefile:24: recipe for target 'default' failed
make: *** [default] Error 2

I inevitably hit Error: There is no specific subroutine for the generic ‘vecgetvalues’ at (1) when I try to compile, following the build procedure in the documentation. For reference, I built adflow and all of its dependencies on the same machine, with all the relevant fields in config.mk properly set. My file for idflow is as follows:

# ----------------------------------------------------------------------
# Config file for Gfortran  with OpenMPI
# ----------------------------------------------------------------------

# ------- Define a possible parallel make ------------------------------
PMAKE = make -j 4

# ------- Define the MPI Compilers--------------------------------------
FF90 = mpif90
CC   = mpicc


# ------- Define CGNS Inlcude and linker flags -------------------------
# Define the CNGS include directory and linking flags for CGNSlib. We
# can use 3.2.x OR CGNS 3.3+. You must define which version is being
# employed as shown below. We are assuming that HDF5 came from PETSc
# so it is included in ${PETSC_LIB}. Otherwise you will have to
# specify the HDF5 library.

# ----------- CGNS ------------------
# CGNS_VERSION_FLAG=               # for CGNS 3.2.x
CGNS_VERSION_FLAG=-DUSECGNSMODULE  # for CGNS 3.3.x
CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns

# ------- Define Compiler Flags ----------------------------------------
FF90_GEN_FLAGS = -fPIC
CC_GEN_FLAGS   = -fPIC

FF90_OPT_FLAGS   =  -fPIC -fdefault-real-8 -O2 
CC_OPT_FLAGS     = -O2

# ------- Define Linker Flags ------------------------------------------
LINKER       = $(FF90)
LINKER_FLAGS =

# ------- Define Petsc Info --- Should not need to modify this -----
include ${PETSC_DIR}/lib/petsc/conf/variables # PETSc 3.6
#include ${PETSC_DIR}/conf/variables # PETSc 3.5
PETSC_INCLUDE_FLAGS=${PETSC_CC_INCLUDES} -I$(PETSC_DIR)
PETSC_LINKER_FLAGS=${PETSC_LIB}

# Define potentially different python, python-config and f2py executables:
PYTHON = python3
PYTHON-CONFIG = python3-config # use python-config for python 2
F2PY = python3 -m numpy.f2py

My flags for including CGNS and PETSC are the same as the ones I used to successfully build adflow. I would appreciate any insight on this, and I'll provide more information if needed.

EDIT: Version information

idwarp: v2.3.0
PETSC: v3.14.3
CGNS: v4.1.2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.