MFEM  v4.6.0
Finite element discretization library
Functions
rubik.cpp File Reference

Go to the source code of this file.

Functions

void interactive_help ()
 
void init_hex_mesh (Mesh &mesh)
 
void init_state ()
 
void print_state (ostream &out)
 
void repaint_cube (Mesh &mesh, GridFunction &color, socketstream &sock)
 
bool validate_centers (const int max_ind=6)
 
bool validate_edges (const int max_ind=12)
 
bool validate_corners (const int max_ind=8)
 
void anim_move (char axis, int tier, int increment, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void anim_move (const Move &move, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void determine_random_moves (Array< Move > &moves)
 
void swap_corners (Mesh &mesh, GridFunction &color, socketstream &sock, int *c0=NULL, int *c1=NULL)
 
void twist_corners (Mesh &mesh, GridFunction &color, socketstream &sock, bool cw, int *c0=NULL, int *c1=NULL, int *c2=NULL)
 
void permute_edges (Mesh &mesh, GridFunction &color, socketstream &sock, int *e0, int *e1, int *e2)
 
void permute_edges (Mesh &mesh, GridFunction &color, socketstream &sock, bool cw)
 
void flip_edges (Mesh &mesh, GridFunction &color, socketstream &sock, int n, int *e0=NULL, int *e1=NULL, int *e2=NULL, int *e3=NULL)
 
void solve_top (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_mid (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_bot (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve (Mesh &mesh, GridFunction &color, socketstream &sock)
 
int main (int argc, char *argv[])
 
void update_centers (char axis, int incr)
 
void update_corners (char axis, int tier, int incr)
 
void update_edges (char axis, int tier, int incr)
 
void update_state (char axis, int tier, int incr)
 
bool validate_centers (const int min_ind, const int max_ind)
 
bool validate_edges (const int min_ind, const int max_ind)
 
bool validate_corners (const int min_ind, const int max_ind)
 
void rotate_step (char axis, int incr, double *x)
 
bool anim_step (char axis, int incr, Mesh &mesh)
 
void mark_elements (Mesh &mesh, char axis, int tier)
 
void solve_top_center (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_centers (Mesh &mesh, GridFunction &color, socketstream &sock)
 
int locate_corner (int ind)
 
void move_to_c4 (int i4, int o4, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_c5 (int i5, int o5, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_c6 (int i6, int o6, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_c7 (int i7, int o7, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_top_corners (Mesh &mesh, GridFunction &color, socketstream &sock)
 
int locate_edge (int ind)
 
void move_to_e4 (int i4, int o4, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e5 (int i5, int o5, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e6 (int i6, int o6, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e7 (int i7, int o7, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e8 (int i8, int o8, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e9 (int i9, int o9, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e10 (int i10, int o10, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void move_to_e11 (int i11, int o11, Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_top_edges (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_mid_edges (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_corner_locations (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_bot_corner_locations (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_corner_orientations (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_edge_locations (Mesh &mesh, GridFunction &color, socketstream &sock)
 
void solve_edge_orientations (Mesh &mesh, GridFunction &color, socketstream &sock)
 

Function Documentation

◆ anim_move() [1/2]

void anim_move ( char  axis,
int  tier,
int  increment,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1159 of file rubik.cpp.

◆ anim_move() [2/2]

void anim_move ( const Move &  move,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 154 of file rubik.cpp.

◆ anim_step()

bool anim_step ( char  axis,
int  incr,
Mesh mesh 
)

Definition at line 1076 of file rubik.cpp.

◆ determine_random_moves()

void determine_random_moves ( Array< Move > &  moves)

Definition at line 1171 of file rubik.cpp.

◆ flip_edges()

void flip_edges ( Mesh mesh,
GridFunction color,
socketstream sock,
int  n,
int *  e0 = NULL,
int *  e1 = NULL,
int *  e2 = NULL,
int *  e3 = NULL 
)

Definition at line 4355 of file rubik.cpp.

◆ init_hex_mesh()

void init_hex_mesh ( Mesh mesh)

Definition at line 406 of file rubik.cpp.

◆ init_state()

void init_state ( )

Definition at line 552 of file rubik.cpp.

◆ interactive_help()

void interactive_help ( )

Definition at line 360 of file rubik.cpp.

◆ locate_corner()

int locate_corner ( int  ind)

Definition at line 1371 of file rubik.cpp.

◆ locate_edge()

int locate_edge ( int  ind)

Definition at line 2128 of file rubik.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 187 of file rubik.cpp.

◆ mark_elements()

void mark_elements ( Mesh mesh,
char  axis,
int  tier 
)

Definition at line 1104 of file rubik.cpp.

◆ move_to_c4()

void move_to_c4 ( int  i4,
int  o4,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1416 of file rubik.cpp.

◆ move_to_c5()

void move_to_c5 ( int  i5,
int  o5,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1614 of file rubik.cpp.

◆ move_to_c6()

void move_to_c6 ( int  i6,
int  o6,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1786 of file rubik.cpp.

◆ move_to_c7()

void move_to_c7 ( int  i7,
int  o7,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1930 of file rubik.cpp.

◆ move_to_e10()

void move_to_e10 ( int  i10,
int  o10,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2855 of file rubik.cpp.

◆ move_to_e11()

void move_to_e11 ( int  i11,
int  o11,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2984 of file rubik.cpp.

◆ move_to_e4()

void move_to_e4 ( int  i4,
int  o4,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2147 of file rubik.cpp.

◆ move_to_e5()

void move_to_e5 ( int  i5,
int  o5,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2259 of file rubik.cpp.

◆ move_to_e6()

void move_to_e6 ( int  i6,
int  o6,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2366 of file rubik.cpp.

◆ move_to_e7()

void move_to_e7 ( int  i7,
int  o7,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2463 of file rubik.cpp.

◆ move_to_e8()

void move_to_e8 ( int  i8,
int  o8,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2552 of file rubik.cpp.

◆ move_to_e9()

void move_to_e9 ( int  i9,
int  o9,
Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2711 of file rubik.cpp.

◆ permute_edges() [1/2]

void permute_edges ( Mesh mesh,
GridFunction color,
socketstream sock,
int *  e0,
int *  e1,
int *  e2 
)

Definition at line 4055 of file rubik.cpp.

◆ permute_edges() [2/2]

void permute_edges ( Mesh mesh,
GridFunction color,
socketstream sock,
bool  cw 
)

Definition at line 4256 of file rubik.cpp.

◆ print_state()

void print_state ( ostream &  out)

Definition at line 876 of file rubik.cpp.

◆ repaint_cube()

void repaint_cube ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 902 of file rubik.cpp.

◆ rotate_step()

void rotate_step ( char  axis,
int  incr,
double *  x 
)

Definition at line 1003 of file rubik.cpp.

◆ solve()

void solve ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 4938 of file rubik.cpp.

◆ solve_bot()

void solve_bot ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 4913 of file rubik.cpp.

◆ solve_bot_corner_locations()

void solve_bot_corner_locations ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 3534 of file rubik.cpp.

◆ solve_centers()

void solve_centers ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1250 of file rubik.cpp.

◆ solve_corner_locations()

void solve_corner_locations ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 3460 of file rubik.cpp.

◆ solve_corner_orientations()

void solve_corner_orientations ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 3942 of file rubik.cpp.

◆ solve_edge_locations()

void solve_edge_locations ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 4281 of file rubik.cpp.

◆ solve_edge_orientations()

void solve_edge_orientations ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 4774 of file rubik.cpp.

◆ solve_mid()

void solve_mid ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 4895 of file rubik.cpp.

◆ solve_mid_edges()

void solve_mid_edges ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 3182 of file rubik.cpp.

◆ solve_top()

void solve_top ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 4868 of file rubik.cpp.

◆ solve_top_center()

void solve_top_center ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 1215 of file rubik.cpp.

◆ solve_top_corners()

void solve_top_corners ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 2059 of file rubik.cpp.

◆ solve_top_edges()

void solve_top_edges ( Mesh mesh,
GridFunction color,
socketstream sock 
)

Definition at line 3097 of file rubik.cpp.

◆ swap_corners()

void swap_corners ( Mesh mesh,
GridFunction color,
socketstream sock,
int *  c0 = NULL,
int *  c1 = NULL 
)

Definition at line 3287 of file rubik.cpp.

◆ twist_corners()

void twist_corners ( Mesh mesh,
GridFunction color,
socketstream sock,
bool  cw,
int *  c0 = NULL,
int *  c1 = NULL,
int *  c2 = NULL 
)

Definition at line 3634 of file rubik.cpp.

◆ update_centers()

void update_centers ( char  axis,
int  incr 
)

Definition at line 560 of file rubik.cpp.

◆ update_corners()

void update_corners ( char  axis,
int  tier,
int  incr 
)

Definition at line 588 of file rubik.cpp.

◆ update_edges()

void update_edges ( char  axis,
int  tier,
int  incr 
)

Definition at line 729 of file rubik.cpp.

◆ update_state()

void update_state ( char  axis,
int  tier,
int  incr 
)

Definition at line 856 of file rubik.cpp.

◆ validate_centers() [1/2]

bool validate_centers ( const int  max_ind = 6)

◆ validate_centers() [2/2]

bool validate_centers ( const int  min_ind,
const int  max_ind 
)

Definition at line 957 of file rubik.cpp.

◆ validate_corners() [1/2]

bool validate_corners ( const int  max_ind = 8)

◆ validate_corners() [2/2]

bool validate_corners ( const int  min_ind,
const int  max_ind 
)

Definition at line 985 of file rubik.cpp.

◆ validate_edges() [1/2]

bool validate_edges ( const int  max_ind = 12)

◆ validate_edges() [2/2]

bool validate_edges ( const int  min_ind,
const int  max_ind 
)

Definition at line 969 of file rubik.cpp.