-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added a script to scale plot3d. * Changed plot3d2tecplot.py * Changed the design variable hist output to JSON format. * Added the AD calculation for ACT derivs. * Fixed the act deriv in parallel. * Updated the version. * Fixed the ACT deriv in parallel. Updated the test. * Fixed the parallel BC derivs. * The AOA deriv is working in parallel. * Updated tests.
- Loading branch information
Showing
24 changed files
with
714 additions
and
279 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env python | ||
""" | ||
This script scale the coordinates in a plot3D file | ||
Usage: python dafoam_plot3dscale.py plot3d_file_input.xyz plot3d_file_output.xyz 2 2 2 | ||
This will scale the x, y, and z coordinates by a factor of 2 | ||
""" | ||
|
||
import sys | ||
from pygeo import * | ||
|
||
inputFileName = sys.argv[1] | ||
outputFileName = sys.argv[2] | ||
scaleX = float(sys.argv[3]) | ||
scaleY = float(sys.argv[4]) | ||
scaleZ = float(sys.argv[5]) | ||
|
||
print( | ||
"Scaling %s to %s with scaleX: %g scaleY: %g scaleZ: %g ...." | ||
% (inputFileName, outputFileName, scaleX, scaleY, scaleZ) | ||
) | ||
|
||
ffd = pyBlock("plot3d", fileName=inputFileName, FFD=True) | ||
|
||
for ivol in range(ffd.nVol): | ||
vals = ffd.vols[ivol].coef | ||
vals[:, :, :, 0] = vals[:, :, :, 0] * scaleX | ||
vals[:, :, :, 1] = vals[:, :, :, 1] * scaleY | ||
vals[:, :, :, 2] = vals[:, :, :, 2] * scaleZ | ||
ffd.writePlot3dCoef(outputFileName) | ||
|
||
print( | ||
"Scaling %s to %s with scaleX: %g scaleY: %g scaleZ: %g Done!" | ||
% (inputFileName, outputFileName, scaleX, scaleY, scaleZ) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.