**process z7p#

Description#

This post-processing provides an interface for user defined post-processing operations using the z7p scripting language (see also the “global” version of this post-processing). The z7p must define the following functions:

  • A function that returns the names of input variables

    ARRAY<STRING> input() { ... }
    
  • A function that returns the names of output variables

    ARRAY<STRING> output() { ... }
    
  • The function that computes output variables

    void compute() { ... }
    
  • A function returning material coefficients (optional)

    ARRAY<STRING> coefficients() { ... }
    
  • Initialization (optional)

    void initialize() { ... }
    
  • Memory Deallocation or extra results dumping (optional)

    void destroy() { ... }
    
  • Additional functions and declarations as needed.

Syntax#

**process z7p script.z7p

Examples#

The following example can be found at $Z7PATH/TESTS/Program_test/Post_test/INP/arm2_loc.inp

***local_post_processing
   **output_number 1-3
   **elset ALL_ELEMENT
   **file integ
   **process z7p arm2_loc.z7p

The script arm2_loc.z7p (see also the “global” version for more comments):

ARRAY<STRING> input()
{
  ARRAY<STRING> i;

  i.resize(4); i[0]="sig11"; i[1]="sig22"; i[2]="sig33"; i[3]="sig12";
  return(i);
}

ARRAY<STRING> output()
{
  ARRAY<STRING> o;

  o.resize(1); o[0]="z7pmises";
  return(o);
}

void initialize()
{
  global double max_mises,min_mises;

  max_mises=-MAX_DOUBLE; min_mises=MAX_DOUBLE;
}

void destroy()
{
  global double max_mises,min_mises;

  endl.print();
  ("Max mises = "+max_mises+endl).print();
  ("Min mises = "+min_mises+endl).print();
  cflush();
}

void compute()
{
  TENSOR2 sigma;
  global double max_mises,min_mises;
  double mises;

  sigma.reassign(4,in,0); // Assign the first 4 values of input data in (already defined)
                          // to the TENSOR2 sigma
  sigma.add_sqrt2();
  mises=sigma.mises();
  out.resize(1);   // resize output variable (already defined)
  out[0]=mises;   // fill output
  if(out[0]<min_mises) min_mises=out[0];
  if(out[0]>max_mises) max_mises=out[0];
}

Note

Some variables are pre-defined to simplify the use of the script.

Variables

description

in

a VECTOR containing input data

out

a VECTOR containing output data