From |kry|ov @end|ng |rom d|@root@org  Tue Jan  9 15:35:29 2024
From: |kry|ov @end|ng |rom d|@root@org (Ivan Krylov)
Date: Tue, 9 Jan 2024 17:35:29 +0300
Subject: [Rd] using Paraview "in-situ" with R?
In-Reply-To: <BL3PR11MB6338D814D9A3FF932D7E7F49BE6A2@BL3PR11MB6338.namprd11.prod.outlook.com>
References: <BL3PR11MB6338D814D9A3FF932D7E7F49BE6A2@BL3PR11MB6338.namprd11.prod.outlook.com>
Message-ID: <20240109173529.7e1ec15b@Tarkus>

? Tue, 9 Jan 2024 14:20:17 +0000
Mike Marchywka <marchywka at hotmail.com> ?????:

> it seems like an excellent tool to interface to R allowing
> visualization without a bunch of temp files or 
> 
> Is anyone aware of anyone doing this interface or reasons its  a
> boondoggle?

This sounds like it's better suited for r-package-devel at r-project.org,
not R-devel itself.

In theory, nothing should prevent you from writing C++ code interfacing
with ParaView (via its "adios" streaming library) and with R. The Rcpp
package will likely help you bring the semantics of the two languages
closer together. (Memory allocation and error handling are the two
major topics where R and C++ especially disagree.)

On the R side, make an object with reference semantics (i.e. an
external pointer) and use callbacks to update it with new information
while R code is running. On the R extension side, translate these
callbacks into necessary calls to the adios library to transfer the
data to ParaView.

For more informaion, see Writing R Extensions at
<https://cran.r-project.org/doc/manuals/R-exts.html> and Rcpp
documentation at <https://CRAN.R-project.org/package=Rcpp>.

-- 
Best regards,
Ivan



[Rd] using Paraview "in-situ" with R?
Ivan Krylov