522 readEcho(in, filename);
523 w().writeRGrid(filename);
525 if (command ==
"WRITE_C_BASIS") {
526 readEcho(in, filename);
527 c().writeBasis(filename);
529 if (command ==
"WRITE_C_RGRID") {
530 readEcho(in, filename);
531 c().writeRGrid(filename);
533 if (command ==
"WRITE_BLOCK_C_RGRID") {
534 readEcho(in, filename);
535 mixture_.writeBlockCRGrid(filename);
537 if (command ==
"WRITE_Q_SLICE") {
538 int polymerId, blockId, directionId, segmentId;
539 readEcho(in, filename);
544 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
545 <<
Str(
"block ID ", 21) << blockId <<
"\n"
546 <<
Str(
"direction ID ", 21) << directionId
548 <<
Str(
"segment ID ", 21) << segmentId
550 mixture_.writeQSlice(filename, polymerId, blockId,
551 directionId, segmentId);
553 if (command ==
"WRITE_Q_TAIL") {
554 readEcho(in, filename);
555 int polymerId, blockId, directionId;
559 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
560 <<
Str(
"block ID ", 21) << blockId <<
"\n"
561 <<
Str(
"direction ID ", 21) << directionId
563 mixture_.writeQTail(filename, polymerId, blockId, directionId);
565 if (command ==
"WRITE_Q") {
566 readEcho(in, filename);
567 int polymerId, blockId, directionId;
571 Log::file() <<
Str(
"polymer ID ", 21) << polymerId <<
"\n"
572 <<
Str(
"block ID ", 21) << blockId <<
"\n"
573 <<
Str(
"direction ID ", 21) << directionId
575 mixture_.writeQ(filename, polymerId, blockId, directionId);
577 if (command ==
"WRITE_Q_ALL") {
578 readEcho(in, filename);
579 mixture_.writeQAll(filename);
581 if (command ==
"WRITE_STARS") {
582 readEcho(in, filename);
583 domain_.writeStars(filename);
585 if (command ==
"WRITE_WAVES") {
586 readEcho(in, filename);
587 domain_.writeWaves(filename);
589 if (command ==
"WRITE_GROUP") {
590 readEcho(in, filename);
591 domain_.writeGroup(filename);
593 if (command ==
"BASIS_TO_RGRID") {
594 readEcho(in, inFileName);
595 readEcho(in, outFileName);
596 fieldIo.convertBasisToRGrid(inFileName, outFileName);
598 if (command ==
"RGRID_TO_BASIS") {
599 readEcho(in, inFileName);
600 readEcho(in, outFileName);
601 fieldIo.convertRGridToBasis(inFileName, outFileName);
603 if (command ==
"KGRID_TO_RGRID") {
604 readEcho(in, inFileName);
605 readEcho(in, outFileName);
606 fieldIo.convertKGridToRGrid(inFileName, outFileName);
608 if (command ==
"RGRID_TO_KGRID") {
609 readEcho(in, inFileName);
610 readEcho(in, outFileName);
611 fieldIo.convertRGridToKGrid(inFileName, outFileName);
613 if (command ==
"BASIS_TO_KGRID") {
614 readEcho(in, inFileName);
615 readEcho(in, outFileName);
616 fieldIo.convertBasisToKGrid(inFileName, outFileName);
618 if (command ==
"KGRID_TO_BASIS") {
619 readEcho(in, inFileName);
620 readEcho(in, outFileName);
621 fieldIo.convertKGridToBasis(inFileName, outFileName);
623 if (command ==
"CHECK_RGRID_SYMMETRY") {
625 readEcho(in, inFileName);
626 readEcho(in, epsilon);
628 hasSymmetry = fieldIo.hasSymmetry(inFileName, epsilon);
631 <<
"Symmetry of r-grid file matches this space group"
632 << std::endl << std::endl;
635 <<
"Symmetry of r-grid file does not match this\n"
636 <<
"space group to within error threshold of "
637 <<
Dbl(epsilon) <<
" ." << std::endl << std::endl;
640 if (command ==
"COMPARE_BASIS") {
641 std::string filecompare1, filecompare2;
642 readEcho(in, filecompare1);
643 readEcho(in, filecompare2);
644 fieldIo.compareFieldsBasis(filecompare1, filecompare2);
646 if (command ==
"COMPARE_RGRID") {
647 std::string filecompare1, filecompare2;
648 readEcho(in, filecompare1);
649 readEcho(in, filecompare2);
650 fieldIo.compareFieldsRGrid(filecompare1, filecompare2);
652 if (command ==
"SCALE_BASIS") {
654 readEcho(in, inFileName);
655 readEcho(in, outFileName);
656 readEcho(in, factor);
657 fieldIo.scaleFieldsBasis(inFileName, outFileName, factor);
659 if (command ==
"SCALE_RGRID") {
661 readEcho(in, inFileName);
662 readEcho(in, outFileName);
663 readEcho(in, factor);
664 fieldIo.scaleFieldsRGrid(inFileName, outFileName, factor);
666 if (command ==
"EXPAND_RGRID_DIMENSION") {
667 readEcho(in, inFileName);
668 readEcho(in, outFileName);
674 Log::file() <<
Str(
"Expand dimension to: ") << d <<
"\n";
679 for (
int i = 0; i < d-D; i++) {
680 in >> newGridDimensions[i];
683 <<
Str(
"Numbers of grid points in added dimensions : ");
684 for (
int i = 0; i < d-D; i++) {
685 Log::file() << newGridDimensions[i] <<
" ";
689 fieldIo.expandRGridDimension(inFileName, outFileName,
690 d, newGridDimensions);
693 if (command ==
"REPLICATE_UNIT_CELL") {
694 readEcho(in, inFileName);
695 readEcho(in, outFileName);
699 for (
int i = 0; i < D; i++){
702 for (
int i = 0; i < D; i++){
703 Log::file() <<
"Replicate unit cell in direction "
708 fieldIo.replicateUnitCell(inFileName, outFileName, replicas);
711 if (command ==
"ESTIMATE_W_BASIS") {
712 readEcho(in, inFileName);
713 readEcho(in, outFileName);
714 fieldIo.estimateWBasis(inFileName, outFileName,
715 interaction().chi());
717 if (command ==
"READ_H_BASIS") {
718 readEcho(in, filename);
719 h().readBasis(filename);
722 if (command ==
"READ_H_RGRID") {
723 readEcho(in, filename);
724 h().readRGrid(filename);
727 if (command ==
"WRITE_H_BASIS") {
728 readEcho(in, filename);
729 h().writeBasis(filename);
731 if (command ==
"WRITE_H_RGRID") {
732 readEcho(in, filename);
733 h().writeRGrid(filename);
735 if (command ==
"READ_MASK_BASIS") {
736 readEcho(in, filename);
737 mask().readBasis(filename);
739 if (command ==
"READ_MASK_RGRID") {
740 readEcho(in, filename);
741 mask().readRGrid(filename);
743 if (command ==
"WRITE_MASK_BASIS") {
744 readEcho(in, filename);
745 mask().writeBasis(filename);
747 if (command ==
"WRITE_MASK_RGRID") {
748 readEcho(in, filename);
749 mask().writeRGrid(filename);
751 if (command ==
"WRITE_TIMERS") {
752 readEcho(in, filename);
754 fileMaster_.openOutputFile(filename, file);
758 if (command ==
"CLEAR_TIMERS") {
762 << command << std::endl;
771 template <
int D,
class T>
774 if (fileMaster_.commandFileName().empty()) {
785 template <
int D,
class T>
803 mixture_.compute(w_.rgrid(), c_.rgrid(), mask_.phiTot());
804 mixture_.setIsSymmetric(w_.isSymmetric());
809 if (w_.isSymmetric()) {
811 domain_.fieldIo().convertRGridToBasis(c_.rgrid(), c_.basis(),
813 c_.setIsSymmetric(
true);
825 template <
int D,
class T>
829 if (!mixture_.hasStress()) {
830 mixture_.computeStress(
mask().phiTot());
845 template <
int D,
class T>
868 int error =
iterator().solve(isContinuation);
892 template <
int D,
class T>
914 template <
int D,
class T>
927 template <
int D,
class T>
930 c_.setHasData(
false);
939 template <
int D,
class T>
944 UTIL_CHECK(domain_.lattice() == unitCell.lattice());
947 domain_.unitCell() = unitCell;
950 if (domain_.hasGroup() && !domain_.basis().isInitialized()) {
955 UTIL_CHECK(domain_.unitCell().isInitialized());
956 UTIL_CHECK(domain_.unitCell().lattice() == domain_.lattice());
957 if (domain_.hasGroup()) {
967 template <
int D,
class T>
975 domain_.unitCell().set(domain_.lattice(), parameters);
977 domain_.unitCell().setParameters(parameters);
981 if (domain_.hasGroup() && !domain_.basis().isInitialized()) {
986 UTIL_CHECK(domain_.unitCell().isInitialized());
987 UTIL_CHECK(domain_.unitCell().lattice() == domain_.lattice());
988 if (domain_.hasGroup()) {
998 template <
int D,
class T>
1002 mixture_.clearUnitCellData();
1003 domain_.waveList().clearUnitCellData();
1014 template <
int D,
class T>
1017 out <<
"SystemTmpl{" << std::endl;
1018 mixture_.writeParam(out);
1020 domain_.writeParam(out);
1027 out <<
"}" << std::endl;
1035 template <
int D,
class T>
1051 template <
int D,
class T>