524 mixture_().writeStress(file);
530 if (command ==
"WRITE_W_BASIS") {
531 readEcho(in, filename);
532 w().writeBasis(filename);
534 if (command ==
"WRITE_W_RGRID") {
535 readEcho(in, filename);
536 w().writeRGrid(filename);
538 if (command ==
"WRITE_C_BASIS") {
539 readEcho(in, filename);
540 c().writeBasis(filename);
542 if (command ==
"WRITE_C_RGRID") {
543 readEcho(in, filename);
544 c().writeRGrid(filename);
546 if (command ==
"WRITE_BLOCK_C_RGRID") {
547 readEcho(in, filename);
548 mixture_().writeBlockCRGrid(filename);
550 if (command ==
"WRITE_Q_SLICE") {
551 int polymerId, blockId, directionId, segmentId;
552 readEcho(in, filename);
557 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
558 <<
Str(
"block ID ", 21) << blockId <<
"\n"
559 <<
Str(
"direction ID ", 21) << directionId
561 <<
Str(
"segment ID ", 21) << segmentId
563 mixture_().writeQSlice(filename, polymerId, blockId,
564 directionId, segmentId);
566 if (command ==
"WRITE_Q_TAIL") {
567 readEcho(in, filename);
568 int polymerId, blockId, directionId;
572 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
573 <<
Str(
"block ID ", 21) << blockId <<
"\n"
574 <<
Str(
"direction ID ", 21) << directionId
576 mixture_().writeQTail(filename, polymerId, blockId, directionId);
578 if (command ==
"WRITE_Q") {
579 readEcho(in, filename);
580 int polymerId, blockId, directionId;
584 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
585 <<
Str(
"block ID ", 21) << blockId <<
"\n"
586 <<
Str(
"direction ID ", 21) << directionId
588 mixture_().writeQ(filename, polymerId, blockId, directionId);
590 if (command ==
"WRITE_Q_ALL") {
591 readEcho(in, filename);
592 mixture_().writeQAll(filename);
594 if (command ==
"WRITE_STARS") {
595 readEcho(in, filename);
596 domain_().writeStars(filename);
598 if (command ==
"WRITE_WAVES") {
599 readEcho(in, filename);
600 domain_().writeWaves(filename);
602 if (command ==
"WRITE_GROUP") {
603 readEcho(in, filename);
604 domain_().writeGroup(filename);
606 if (command ==
"BASIS_TO_RGRID") {
607 readEcho(in, inFileName);
608 readEcho(in, outFileName);
609 fieldIo.convertBasisToRGrid(inFileName, outFileName);
611 if (command ==
"RGRID_TO_BASIS") {
612 readEcho(in, inFileName);
613 readEcho(in, outFileName);
614 fieldIo.convertRGridToBasis(inFileName, outFileName);
616 if (command ==
"KGRID_TO_RGRID") {
617 readEcho(in, inFileName);
618 readEcho(in, outFileName);
619 fieldIo.convertKGridToRGrid(inFileName, outFileName);
621 if (command ==
"RGRID_TO_KGRID") {
622 readEcho(in, inFileName);
623 readEcho(in, outFileName);
624 fieldIo.convertRGridToKGrid(inFileName, outFileName);
626 if (command ==
"BASIS_TO_KGRID") {
627 readEcho(in, inFileName);
628 readEcho(in, outFileName);
629 fieldIo.convertBasisToKGrid(inFileName, outFileName);
631 if (command ==
"KGRID_TO_BASIS") {
632 readEcho(in, inFileName);
633 readEcho(in, outFileName);
634 fieldIo.convertKGridToBasis(inFileName, outFileName);
636 if (command ==
"CHECK_RGRID_SYMMETRY") {
638 readEcho(in, inFileName);
639 readEcho(in, epsilon);
641 hasSymmetry = fieldIo.hasSymmetry(inFileName, epsilon);
644 <<
"Symmetry of r-grid file matches this space group"
645 << std::endl << std::endl;
648 <<
"Symmetry of r-grid file does not match this\n"
649 <<
"space group to within error threshold of "
650 <<
Dbl(epsilon) <<
" ." << std::endl << std::endl;
653 if (command ==
"COMPARE_BASIS") {
654 std::string filecompare1, filecompare2;
655 readEcho(in, filecompare1);
656 readEcho(in, filecompare2);
657 fieldIo.compareFieldsBasis(filecompare1, filecompare2);
659 if (command ==
"COMPARE_RGRID") {
660 std::string filecompare1, filecompare2;
661 readEcho(in, filecompare1);
662 readEcho(in, filecompare2);
663 fieldIo.compareFieldsRGrid(filecompare1, filecompare2);
665 if (command ==
"SCALE_BASIS") {
667 readEcho(in, inFileName);
668 readEcho(in, outFileName);
669 readEcho(in, factor);
670 fieldIo.scaleFieldsBasis(inFileName, outFileName, factor);
672 if (command ==
"SCALE_RGRID") {
674 readEcho(in, inFileName);
675 readEcho(in, outFileName);
676 readEcho(in, factor);
677 fieldIo.scaleFieldsRGrid(inFileName, outFileName, factor);
679 if (command ==
"EXPAND_RGRID_DIMENSION") {
680 readEcho(in, inFileName);
681 readEcho(in, outFileName);
687 Log::file() <<
Str(
"Expand dimension to: ") << d <<
"\n";
692 for (
int i = 0; i < d-D; i++) {
693 in >> newGridDimensions[i];
696 <<
Str(
"Numbers of grid points in added dimensions : ");
697 for (
int i = 0; i < d-D; i++) {
698 Log::file() << newGridDimensions[i] <<
" ";
702 fieldIo.expandRGridDimension(inFileName, outFileName,
703 d, newGridDimensions);
706 if (command ==
"REPLICATE_UNIT_CELL") {
707 readEcho(in, inFileName);
708 readEcho(in, outFileName);
712 for (
int i = 0; i < D; i++){
715 for (
int i = 0; i < D; i++){
716 Log::file() <<
"Replicate unit cell in direction "
721 fieldIo.replicateUnitCell(inFileName, outFileName, replicas);
724 if (command ==
"ESTIMATE_W_BASIS") {
725 readEcho(in, inFileName);
726 readEcho(in, outFileName);
727 fieldIo.estimateWBasis(inFileName, outFileName,
728 interaction().chi());
730 if (command ==
"READ_H_BASIS") {
731 readEcho(in, filename);
732 h().readBasis(filename);
735 if (command ==
"READ_H_RGRID") {
736 readEcho(in, filename);
737 h().readRGrid(filename);
740 if (command ==
"WRITE_H_BASIS") {
741 readEcho(in, filename);
742 h().writeBasis(filename);
744 if (command ==
"WRITE_H_RGRID") {
745 readEcho(in, filename);
746 h().writeRGrid(filename);
748 if (command ==
"READ_MASK_BASIS") {
749 readEcho(in, filename);
750 mask().readBasis(filename);
752 if (command ==
"READ_MASK_RGRID") {
753 readEcho(in, filename);
754 mask().readRGrid(filename);
756 if (command ==
"WRITE_MASK_BASIS") {
757 readEcho(in, filename);
758 mask().writeBasis(filename);
760 if (command ==
"WRITE_MASK_RGRID") {
761 readEcho(in, filename);
762 mask().writeRGrid(filename);
764 if (command ==
"WRITE_TIMERS") {
765 readEcho(in, filename);
767 fileMaster().openOutputFile(filename, file);
771 if (command ==
"CLEAR_TIMERS") {
775 << command << std::endl;
784 template <
int D,
class T>
798 template <
int D,
class T>
816 mixture_().compute(w_.rgrid(), c_.rgrid(), mask_.phiTot());
817 mixture_().setIsSymmetric(w_.isSymmetric());
822 if (w_.isSymmetric()) {
824 domain_().fieldIo().convertRGridToBasis(c_.rgrid(), c_.basis(),
826 c_.setIsSymmetric(
true);
838 template <
int D,
class T>
842 if (!mixture_().hasStress()) {
843 mixture_().computeStress(
mask().phiTot());
858 template <
int D,
class T>
881 int error =
iterator().solve(isContinuation);
889 if (!mixture_().hasStress()) {
905 template <
int D,
class T>
927 template <
int D,
class T>
940 template <
int D,
class T>
943 c_.setHasData(
false);
952 template <
int D,
class T>
957 UTIL_CHECK(domain_().lattice() == unitCell.lattice());
960 domain_().unitCell() = unitCell;
963 if (domain_().hasGroup() && !domain_().basis().isInitialized()) {
964 domain_().makeBasis();
968 UTIL_CHECK(domain_().unitCell().isInitialized());
969 UTIL_CHECK(domain_().unitCell().lattice() == domain_().lattice());
970 if (domain_().hasGroup()) {
971 UTIL_CHECK(domain_().basis().isInitialized());
980 template <
int D,
class T>
988 domain_().unitCell().set(domain_().lattice(), parameters);
990 domain_().unitCell().setParameters(parameters);
994 if (domain_().hasGroup() && !domain_().basis().isInitialized()) {
995 domain_().makeBasis();
999 UTIL_CHECK(domain_().unitCell().isInitialized());
1000 UTIL_CHECK(domain_().unitCell().lattice() == domain_().lattice());
1001 if (domain_().hasGroup()) {
1002 UTIL_CHECK(domain_().basis().isInitialized());
1011 template <
int D,
class T>
1015 mixture_().clearUnitCellData();
1016 domain_().waveList().clearUnitCellData();
1027 template <
int D,
class T>
1030 out <<
"SystemTmpl{" << std::endl;
1033 domain().writeParam(out);
1040 out <<
"}" << std::endl;
1048 template <
int D,
class T>
1064 template <
int D,
class T>