How to use PixelFlow to initialize a specific shape?

I’m learning the example ‘Fluid_GetStarted’, and I wanna create a rectangle fluid at the beginning.This rectangle will only be generated once so I don’t put my code in the ‘fluid.update()’. I find that addDensity(processing.opengl.PGraphics2D pg, float intensity_scale, int blend_mode, float mix)* is in the reference. I’ve tried the code below in ‘setup()’ but it doesn’t work. Could anyone help me?

    pg2 = (PGraphics2D) createGraphics(width, height, P2D);
    pg2.beginDraw();
    pg2.clear();
    pg2.fill(255,255,0);
    pg2.rect(width/2,height/2,20,20);
    pg2.endDraw();
    fluid.addDensity(pg2,10,10,10);