MFEM  v4.3.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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

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

Definition at line 1164 of file rubik.cpp.

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

Definition at line 154 of file rubik.cpp.

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

Definition at line 1076 of file rubik.cpp.

void determine_random_moves ( Array< Move > &  moves)

Definition at line 1176 of file rubik.cpp.

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 4360 of file rubik.cpp.

void init_hex_mesh ( Mesh mesh)

Definition at line 406 of file rubik.cpp.

void init_state ( )

Definition at line 552 of file rubik.cpp.

void interactive_help ( )

Definition at line 360 of file rubik.cpp.

int locate_corner ( int  ind)

Definition at line 1376 of file rubik.cpp.

int locate_edge ( int  ind)

Definition at line 2133 of file rubik.cpp.

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

Definition at line 187 of file rubik.cpp.

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

Definition at line 1104 of file rubik.cpp.

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

Definition at line 1421 of file rubik.cpp.

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

Definition at line 1619 of file rubik.cpp.

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

Definition at line 1791 of file rubik.cpp.

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

Definition at line 1935 of file rubik.cpp.

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

Definition at line 2860 of file rubik.cpp.

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

Definition at line 2989 of file rubik.cpp.

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

Definition at line 2152 of file rubik.cpp.

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

Definition at line 2264 of file rubik.cpp.

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

Definition at line 2371 of file rubik.cpp.

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

Definition at line 2468 of file rubik.cpp.

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

Definition at line 2557 of file rubik.cpp.

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

Definition at line 2716 of file rubik.cpp.

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

Definition at line 4060 of file rubik.cpp.

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

Definition at line 4261 of file rubik.cpp.

void print_state ( ostream &  out)

Definition at line 876 of file rubik.cpp.

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

Definition at line 902 of file rubik.cpp.

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

Definition at line 1003 of file rubik.cpp.

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

Definition at line 4943 of file rubik.cpp.

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

Definition at line 4918 of file rubik.cpp.

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

Definition at line 3539 of file rubik.cpp.

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

Definition at line 1255 of file rubik.cpp.

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

Definition at line 3465 of file rubik.cpp.

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

Definition at line 3947 of file rubik.cpp.

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

Definition at line 4286 of file rubik.cpp.

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

Definition at line 4779 of file rubik.cpp.

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

Definition at line 4900 of file rubik.cpp.

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

Definition at line 3187 of file rubik.cpp.

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

Definition at line 4873 of file rubik.cpp.

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

Definition at line 1220 of file rubik.cpp.

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

Definition at line 2064 of file rubik.cpp.

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

Definition at line 3102 of file rubik.cpp.

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

Definition at line 3292 of file rubik.cpp.

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

Definition at line 3639 of file rubik.cpp.

void update_centers ( char  axis,
int  incr 
)

Definition at line 560 of file rubik.cpp.

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

Definition at line 588 of file rubik.cpp.

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

Definition at line 729 of file rubik.cpp.

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

Definition at line 856 of file rubik.cpp.

bool validate_centers ( const int  max_ind = 6)
bool validate_centers ( const int  min_ind,
const int  max_ind 
)

Definition at line 957 of file rubik.cpp.

bool validate_corners ( const int  max_ind = 8)
bool validate_corners ( const int  min_ind,
const int  max_ind 
)

Definition at line 985 of file rubik.cpp.

bool validate_edges ( const int  max_ind = 12)
bool validate_edges ( const int  min_ind,
const int  max_ind 
)

Definition at line 969 of file rubik.cpp.