Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field access checks #444

Merged
merged 4 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions models/electrokinetic/d2q9_poison_boltzmann/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING



AddDensity( name="g[0]", dx= 0, dy= 0, group="g")
AddDensity( name="g[1]", dx= 1, dy= 0, group="g")
Expand Down
7 changes: 7 additions & 0 deletions models/experimental/d3q27_csf/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING



U = expand.grid(-1:1,-1:1,-1:1)

Expand Down
5 changes: 3 additions & 2 deletions models/flow/auto/Dynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ AddNodeType(name="Body", group="BODY")
for (f in fname) AddField(f,dx=0,dy=0,dz=0) # Make f accessible also in present node (not only streamed)

if (Options$part) {
AddStage("BaseIteration", "Run", save=Fields$group %in% c("f","Force"), load = DensityAll$group %in% c("f","Force"))
AddStage("CalcF", save=Fields$group == "Force", load = DensityAll$group %in% c("f","Force"), particle=TRUE)
AddStage("BaseIteration", "Run", save=Fields$group %in% c("f"), load = DensityAll$group %in% c("f","Force"))
AddStage("BaseInit", "Init", save=Fields$group %in% c("f"))
AddStage("CalcF", save=Fields$group == "Force", load = DensityAll$group %in% c("f"), particle=TRUE)
AddAction("Iteration", c("BaseIteration", "CalcF"))
AddAction("Init", c("BaseInit", "CalcF"))
}
Expand Down
7 changes: 7 additions & 0 deletions models/flow/d2q9_par/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
# name - variable name to stream
# dx,dy,dz - direction of streaming
Expand Down
7 changes: 7 additions & 0 deletions models/flow/d3q27_cumulant_part/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


x = c(0,1,-1);
P = expand.grid(x=0:2,y=0:2,z=0:2)
U = expand.grid(x,x,x)
Expand Down
7 changes: 7 additions & 0 deletions models/heat/d3q27_tePSM_per/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING



AddDensity( name="f[0]", dx= 0, dy= 0, dz= 0, group="f")
AddDensity( name="f[1]", dx= 1, dy= 0, dz= 0, group="f")
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/d2q9_ShanChen/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING



# Fluid Density Populations
AddDensity( name="f[0]", dx= 0, dy= 0, group="f")
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/d2q9_csf/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
# name - variable name to stream
# dx,dy,dz - direction of streaming
Expand Down
2 changes: 1 addition & 1 deletion models/multiphase/d2q9_kuper/Dynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AddField("phi",stencil2d=1);

AddStage("BaseIteration", "Run", save=Fields$group == "f", load=DensityAll$group == "f")
AddStage("CalcPhi", save="phi",load=DensityAll$group == "f")
AddStage("BaseInit", "Init", save=Fields$group == "f", load=DensityAll$group == "f")
AddStage("BaseInit", "Init", save=Fields$group == "f")

AddAction("Iteration", c("BaseIteration","CalcPhi"))
AddAction("Init", c("BaseInit","CalcPhi"))
Expand Down
17 changes: 8 additions & 9 deletions models/multiphase/d2q9_pf/Dynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ if (Options$fd) {
AddField("phi" ,stencil2d=1 );

AddStage("BaseIteration", "Run",
load=DensityAll$group == "h" | DensityAll$group == "f" | DensityAll$group == "BC",
save=Fields$group=="h" | Fields$group=="f"
)
load=DensityAll$group == "h" | DensityAll$group == "f" | DensityAll$group == "BC",
save=Fields$group=="h" | Fields$group=="f" | Fields$group == "BC"
)
AddStage("CalcPhi",
save=Fields$name=="phi" ,
load=DensityAll$group == "h"
)
save=Fields$name=="phi" ,
load=DensityAll$group == "h"
)
AddStage("BaseInit", "Init",
load=DensityAll$group == "BC",
save=Fields$group=="h" | Fields$group == "f"

load=FALSE,
save=Fields$group=="h" | Fields$group == "f" | Fields$group == "BC"
)
AddAction("Iteration", c("BaseIteration","CalcPhi"))
AddAction("Init", c("BaseInit","CalcPhi"))
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/d2q9_pf_pressureEvolution/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
# name - variable name to stream
# dx,dy,dz - direction of streaming
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/d2q9_pf_velocity/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
# Pressure Evolution:
AddDensity( name="g[0]", dx= 0, dy= 0, group="g")
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/d2q9_scmp/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING



AddDensity( name="f[0]", dx= 0, dy= 0, group="f")
AddDensity( name="f[1]", dx= 1, dy= 0, group="f")
Expand Down
2 changes: 1 addition & 1 deletion models/multiphase/d3q19_kuper/Dynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ AddField("phi",stencil3d=1);

AddStage("BaseIteration", "Run", save=Fields$group == "f", load=DensityAll$group == "f")
AddStage("CalcPhi", save="phi",load=DensityAll$group == "f")
AddStage("BaseInit", "Init", save=Fields$group == "f", load=DensityAll$group == "f")
AddStage("BaseInit", "Init", save=Fields$group == "f")

AddAction("Iteration", c("BaseIteration","CalcPhi"))
AddAction("Init", c("BaseInit","CalcPhi"))
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/d3q27_pf_velocity/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
# Velocity-based Evolution d3q27:
source("lattice.R")
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/experimental/d2q9_pp_LBL/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Fluid Density Populations
AddDensity( name="f[0]", dx= 0, dy= 0, group="f")
AddDensity( name="f[1]", dx= 1, dy= 0, group="f")
Expand Down
7 changes: 7 additions & 0 deletions models/multiphase/experimental/d2q9_pp_MCMP/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


# Density - table of variables of LB Node to stream
AddDensity( name="f[0]", dx= 0, dy= 0, group="f")
AddDensity( name="f[1]", dx= 1, dy= 0, group="f")
Expand Down
7 changes: 7 additions & 0 deletions models/reaction/d2q9_reaction_diffusion_system/Dynamics.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Setting permissive access policy.
# * This skips checks of fields being overwritten or read prematurely.
# * Otherwise the model compilation was failing.
# * This should be removed if the issue is fixed
SetOptions(permissive.access=TRUE) ### WARNING


if (Options$AllenCahn) {
Qname = 'Allen-Cahn'
DREs <- ('PHI')
Expand Down
5 changes: 3 additions & 2 deletions src/LatticeAccess.inc.cpp.Rt
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ CudaDeviceFunction flag_t LatticeContainer::getType(int x, int y, int z) const
)
))
all_stages = lapply(all_stages, function(s) {
if (is.null(s$load.densities)) s$load.densities = DensityAll[,s$tag];
if (is.null(s$save.fields)) s$save.fields = Fields[,s$tag];
if (is.null(s$load.densities)) s$load.densities = DensityAll[,s$loadtag];
if (is.null(s$save.fields)) s$save.fields = Fields[,s$savetag];
if (is.null(s$suffix)) s$suffix = paste("_",s$name,sep="")
s
})
Expand All @@ -225,6 +225,7 @@ CudaDeviceFunction flag_t LatticeContainer::getType(int x, int y, int z) const
real_to_storage = function(val,f) storage_convert("real_to_storage",val,f)



resolve.symmetries = function(D) {
if (nrow(D) < 1) return();
dp = D[,c("dx","dy","dz"),drop=FALSE]
Expand Down
3 changes: 3 additions & 0 deletions src/SUMMARY.Rt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?R
plot.access=TRUE
source("conf.R")
save.image(file="SUMMARY.Rdata")
options(width=4000)
Expand Down Expand Up @@ -45,4 +46,6 @@
cat(sprintf("%-35s [%7s] | %1s | %s",s$name, s$unit, ifelse(s$adjoint, "X"," "), s$comment),"\n");
}
cat("---------------------------------------------------------------------------------------\n");
cat("\n");
cat("Field access plot: ", paste0("file://",getwd(),"/field_access.pdf"),"\n")
?>
Loading