Skip to content
Marc & Structures
Index

Save your progress

Enter your email and we will send a secure sign-in link. There is no password and the first link creates your account.

Demonstration ~8 min · ~30 min remaining

Audit and executable contract

Check overlaps, restore the selection, and package the regions as reproducible evidence.

Step 7 — Construct tip_top_nodes via intersection

The top edge of the tip meets two simultaneous conditions: belong to tip_nodes and to top_nodes.

CMSEL,S,tip_nodes
CMSEL,R,top_nodes
*GET,n_tip_top,NODE,0,COUNT
CM,tip_top_nodes,NODE
ALLSEL,ALL

CMSEL,S retrieves the first component. CMSEL,R intersects it with the b. The result must be non-empty, less than the full face of the tip and less than all the top face:

0 < n_tip_top < n_tip
0 < n_tip_top < n_top

Step 8 — Demonstrate that the ends do not overlap

A positive-length beam cannot have nodes belonging to both ends:

CMSEL,S,fixed_nodes
CMSEL,R,tip_nodes
*GET,n_overlap,NODE,0,COUNT
ALLSEL,ALL

*GET,n_restored,NODE,0,COUNT

The expected conditions are:

n_overlap  = 0
n_restored = n_nodes

The first is a physical check. The second is a health check: it confirms that no accidental filters will continue to affect subsequent modules.

Step 9 — Turn regions into an executable contract

A component that exists by name may be empty or contain too much. The deliverable evaluates all relationships and summarizes the result in passes:

passes=1
*IF,n_fixed,LE,0,THEN
  passes=0
*ENDIF
*IF,n_overlap,NE,0,THEN
  passes=0
*ENDIF
*IF,n_restored,NE,n_nodes,THEN
  passes=0
*ENDIF

Then generate legible evidence:

*CFOPEN,m02_selection_audit,csv
*VWRITE
('case,beam_l,beam_h,mesh_h,n_nodes,n_elements,n_fixed,n_tip,n_top,n_mid_elems,n_tip_top,n_overlap,n_restored,passes')
...
*CFCLOS

Open m02_selection_audit.csv and check that the last column is valid 1. Exact counts may vary; the relationships recorded in the file 02_expected_results.csv must always be adhered to.

The pattern to keep

Select → count → name → restore → recover → audit

Translated to APDL:

NSEL,S,...
*GET,n_region,NODE,0,COUNT
CM,region_nodes,NODE
ALLSEL,ALL

CMSEL,S,region_nodes
! operation on the region
ALLSEL,ALL

This pattern separates the definition of a region from its use. In M05 we may apply constraints or loads to components whose meaning has already been proven.