Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

RBF Coarsening: save selected points in pointZone in OpenFOAM for reuse or plotting (when requested?) #12

Closed
screambeard opened this issue Feb 27, 2015 · 5 comments

Comments

@screambeard
Copy link
Collaborator

To see which points are selected for RBF motion a pointZone would be ideal, since a pointZone can be opened by paraview.

@davidsblom
Copy link
Owner

Do you have some hints on how to implement this? Not really familiar with pointZones.

@screambeard
Copy link
Collaborator Author

I never programmed pointZones, only created them from sets using the utility setsToZones. So I would start with looking at that utility. Next week I will check it out myself, but I though lets add it to the issue list :).

@davidsblom
Copy link
Owner

I've made a simple implementation to dump the positions matrix to disk. The exportSelectedPoints option should be set in the dynamicMeshDictFile.
This is an example python script to visualize the points for a 3d test case with matplotlib.

#!/usr/bin/env python

import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import axes3d

positions = np.loadtxt( "fluid/rbf-coarsening-greedy-selection-0.txt" )

fig = plt.figure()
ax = fig.gca( projection='3d' )
ax.plot( positions[:,0], positions[:,1], positions[:,2], 'o' )

positions = np.loadtxt( "fluid/rbf-coarsening-greedy-selection-1.txt" )

fig = plt.figure()
ax = fig.gca( projection='3d' )
ax.plot( positions[:,0], positions[:,1], positions[:,2], 'o' )

plt.show()

@davidsblom
Copy link
Owner

write the data out as a csv file

@davidsblom davidsblom reopened this Apr 9, 2015
@davidsblom
Copy link
Owner

CSV output is already possible, using something like this:
  IOFormat CSVFmt(FullPrecision, 0, ", ");
// or
  IOFormat CSVFmt(FullPrecision, DontAlignCols, ",\t");
// and then
  std::cout << A.format(CSVFmt);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants