-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'CFD-GO:develop' into develop
- Loading branch information
Showing
9 changed files
with
173 additions
and
123 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -23,4 +23,5 @@ p | |
/*.txt | ||
.idea/* | ||
*.ipynb_checkpoint* | ||
test-*/ | ||
tools/.format/* |
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,62 @@ | ||
<?xml version="1.0"?> | ||
<CLBConfig version="2.0" output="output/" permissive="true"> | ||
<Geometry nx="1024" ny="100"> | ||
<MRT> | ||
<Box/> | ||
</MRT> | ||
<WVelocity name="Inlet"> | ||
<Inlet/> | ||
</WVelocity> | ||
<EPressure name="Outlet"> | ||
<Outlet/> | ||
</EPressure> | ||
<Inlet nx="1" dx="5"> | ||
<Box/> | ||
</Inlet> | ||
<Outlet nx="1" dx="-5"> | ||
<Box/> | ||
</Outlet> | ||
<Wall mask="ALL"> | ||
<Channel/> | ||
<Wedge dx="120" nx="20" dy="50" ny="20" direction="LowerRight"/> | ||
<Wedge dx="120" nx="20" dy="30" ny="20" direction="UpperRight"/> | ||
<Wedge dx="140" nx="20" dy="50" ny="20" direction="LowerLeft"/> | ||
<Wedge dx="140" nx="20" dy="30" ny="20" direction="UpperLeft"/> | ||
</Wall> | ||
</Geometry> | ||
<Model> | ||
<Param name="VelocityX" value="0.01"/> | ||
<Param name="Viscosity" value="0.02"/> | ||
<Param name="Smag" value="0.16"/> | ||
<Param name="PressDiffInObj" value="1"/> | ||
<Param name="EOSScale" value="0.05"/> | ||
<Param name="Tension" value="0.01"/> | ||
<Param name="Coriolis" value="0.001"/> | ||
<Param name="SolidAlfa" value="0.166"/> | ||
<Param name="FluidAlfa" value="0.01"/> | ||
<Param name="InitTemperature" value="0"/> | ||
<Param name="InletTemperature" value="1"/> | ||
</Model> | ||
<RunPython> | ||
import vtk; | ||
from vtk.util import numpy_support | ||
</RunPython> | ||
<RunPython Iterations="1000"> | ||
img = vtk.vtkImageData() | ||
tab = Solver.Geometry.X | ||
img.SetDimensions(tab.shape[0]+1, tab.shape[1]+1, tab.shape[2]+1) | ||
|
||
for n,tab in Solver.Quantities: | ||
vtk_data = numpy_support.numpy_to_vtk(num_array=tab.reshape(-1,order='F')) | ||
vtk_data.SetName(n) | ||
if len(tab.shape) == 4: | ||
vtk_data.SetNumberOfComponents(tab.shape[0]) | ||
img.GetCellData().AddArray(vtk_data) | ||
|
||
writer = vtk.vtkXMLImageDataWriter() | ||
writer.SetFileName("test.vti") | ||
writer.SetInputData(img) | ||
writer.Update() | ||
</RunPython> | ||
<Solve Iterations="10000"/> | ||
</CLBConfig> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Submodule external
updated
7 files
+0 −3 | d2q9/karman.test | |
+4 −0 | d2q9/karman_p2.test | |
+10 −0 | d2q9/karman_rs.test | |
+35 −0 | d2q9/karman_rs.xml | |
+12 −0 | d2q9/karman_rs_p2.test | |
+2 −1 | d2q9_bc/rinside/runexternal.test | |
+2 −1 | d2q9_kuper/rinside/drop.test |
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,67 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
library(optparse) | ||
options <- list( | ||
make_option(c("-o","--output"), "store", default="", help="Output file", type="character"), | ||
make_option(c("-c","--continue"), "store", default="Iteration,Time_si,Walltime", help="regexp for columns to continue by addition (default: Iteration,Time_si,Walltime)", type="character"), | ||
make_option(c("-d","--discard"), "store", default="", help="regexp for columns to discard (separate by '|')", type="character") | ||
) | ||
|
||
opt <- parse_args(OptionParser(usage="Usage: csvconcatenate -o file file1 file2 file3", options), positional_arguments=TRUE) | ||
|
||
read = function(f) { | ||
if (! file.exists(f)) stop(paste("File not found:",f)) | ||
tab = try(read.csv(f),silent=TRUE) | ||
if (inherits(tab, "try-error")) stop(paste(f,"is not a valid CSV file")) | ||
tab | ||
} | ||
|
||
args = opt$args | ||
opt = opt$options | ||
|
||
opt$discard = strsplit(opt$discard,",")[[1]] | ||
if (! is.character(opt$discard)) stop("Discard list is not text") | ||
|
||
opt$continue = strsplit(opt$continue,",")[[1]] | ||
if (! is.character(opt$continue)) stop("Continue list is not text") | ||
|
||
grepl_any = function(pattern, x, ...) { | ||
sel = rep(FALSE,length(x)) | ||
for (p in pattern) sel = sel | grepl(p, x, ...) | ||
sel | ||
} | ||
|
||
if (length(args) < 1) stop("No csv files provided") | ||
tab = NULL | ||
for (fn in args) { | ||
tab1 = read(fn) | ||
sel = grepl_any(opt$discard, names(tab1)) | ||
if (any(sel)) tab1=tab1[,!sel] | ||
if (is.null(tab)) { | ||
tab = tab1 | ||
} else { | ||
if ( ! identical(sort(names(tab)), sort(names(tab1))) ) { | ||
cat("names (header) not identical:\n") | ||
print(sort(names(tab))) | ||
print(sort(names(tab1))) | ||
q(status=-2) | ||
} | ||
sel = grepl_any(opt$continue, names(tab1)) | ||
if (any(sel)) { | ||
for (cn in names(tab1)[sel]) { | ||
if (! cn %in% names(tab)) stop(cn,"not in previous csv files") | ||
tab1[[cn]] = tab1[[cn]] + max(tab[[cn]]) | ||
} | ||
} | ||
tab = rbind(tab,tab1) | ||
} | ||
} | ||
|
||
if (opt$output != "") { | ||
write.csv(tab, opt$output, row.names=FALSE) | ||
} else { | ||
write.csv(tab, row.names=FALSE) | ||
} | ||
|
||
q(status=0); | ||
|
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