Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 380
    • Issues 380
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1057

Closed
Open
Created Oct 30, 2018 by Admin@OpenFOAM-adminMaintainer

add color values to x3d output

I'd like to be able to specify a color profile to be added to the x3d output for isoSurfaces. For example, an isoSurface of fuel fraction can colored by temperature,

flame
{
    type surfaces;
    functionObjectLibs ("libsampling.so");
    enabled         true;
    writeControl   adjustableRunTime;
    writeInterval   $...animationOutputTime;
    interpolationScheme cellPoint;
    surfaceFormat x3d;
    // Fields to be sampled
    fields
    (
            T
    );
    surfaces
    (
            flame
            {
                type            isoSurfaceCell;
                isoField        ft;
                isoValue        0.06;
                interpolate     true;
                regularise      false;
            }
     );
}

and have the actual color associated with each temperature value stored within the x3d file. I currently do this by writing out a vtk surface with the corresponding interpolated field, then piping this through pvbatch/pvpython to apply a color profile:

# get color transfer function/color map for 'T'
tLUT = GetColorTransferFunction('T')
tLUT.RGBPoints = [291.96875, 0.231373, 0.298039, 0.752941, 1033.3699340820312, 0.865003, 0.865003, 0.865003, 1774.7711181640625, 0.705882, 0.0156863, 0.14902]

# or
tLUT.ApplyPreset('heated_object', True)

This creates a cumbersome extra postProcessing step that I'd like to avoid. Ideally the user would be able to specify either a locally saved color profile or a list of RGB points and associated scalar values and then OpenFOAM would directly add the color profile to the x3d output.

Assignee
Assign to
Time tracking