Exemplo n.º 1
0
 // function
 public override string output_before(ref makeinpdata md, ref setting st)
 {
     // no use-matrix
     md.isusecheckfile = true;
     md.chklocation    = getscrfilepath(md, st);
     return("");
 }
Exemplo n.º 2
0
        public string output(makeinpdata md, setting st)
        {
            var rst = "";

            rst += output_before(ref md, ref st);
            rst +=
                "!-- This inputfile generate by 'makeinp' Ver:0.9.5 --!\n" +
                "$RunGauss\n" +
                (md.no_assgn ? "!" : "") + valueset("%nproc", md.nproc.ToString()) + "\n" +
                valueset("%mem", md.mem.ToString() + md.mem_unit) + "\n" +
                valueset("%chk", getscrfilepath(md, st)) + "\n" +
                "#p " + md.GetMethodName() + "\n" +
                this.output_addition(md, st) +
                (!md.no_scf_output ? valueset("scf", md.scf.Split(',')) + "\n" : "") +
                valueset("iop", md.iop.Split(',')) + "\n" +
                (md.isusecheckfile ? "guess=read geom=check \n" : "") +
                "\n" +
                genfilename(md) + " " + getmethodabst(md) + "\n" +
                "\n" +
                md.charge + " " + md.spin + "\n" +
                (!md.isusecheckfile ? md.inputdata.GetLocation(md.lockpos.ToArray()) : "");
            rst += output_after(ref md, ref st);
            rst += "\n";
            return(rst);
        }
Exemplo n.º 3
0
        public override string output_addition(makeinpdata md, setting st)
        {
            var rst =
                valueset("pop", "nboread") + "\n" +
                "";

            return(rst);
        }
Exemplo n.º 4
0
        public override string output_addition(makeinpdata md, setting st)
        {
            var rst =
                valueset("pop", "reg") + "\n" +
                valueset("freq", md.freq_mode) + "\n" +
                "";

            return(rst);
        }
Exemplo n.º 5
0
        public override string output_addition(makeinpdata md, setting st)
        {
            var rst =
                valueset("pop", "none") + "\n" +
                valueset("irc", "maxpoints=" + md.ircmaxpoint, md.ircforcemode, "reverse") + "\n" +
                "";

            return(rst);
        }
Exemplo n.º 6
0
        public override string output_addition(makeinpdata md, setting st)
        {
            var rst =
                valueset("TD", md.td_calctype, "Nstate=" + md.td_nstate) + "\n" +
                valueset("density", md.td_density) + "\n" +
                valueset("pop", "reg") + "\n" +
                "";

            return(rst);
        }
Exemplo n.º 7
0
        public bool writefile(makeinpdata md, setting st)
        {
            var filename = outputPath(md);
            var output   = this.output(md, st);
            var wfile    = new StreamWriter(filename);

            wfile.Write(output);
            wfile.Close();
            return(true);
        }
Exemplo n.º 8
0
        public string getscrfilepath(makeinpdata md, setting st)
        {
            var rst = st.scrDir + st.scrName;

            rst = rst.Replace("%user%", st.usrName);
            rst = rst.Replace("%name%", this.genscrfilename(md));
            rst = rst.Replace("%option%", this.OptionName);
            rst = rst.Replace("%ext%", this.Extension);
            return(rst);
        }
Exemplo n.º 9
0
 // makeinpdata apply
 private void midApply(ref makeinpdata mid)
 {
     // main
     mid.inputdata      = inputData;
     mid.isusecheckfile = isUseCheckfile;
     mid.chklocation    = UseChkLocation;
     mid.name           = txb_name.Text;
     mid.location       = savLocation;
     mid.nproc          = (int)nmr_nproc.Value;
     mid.no_assgn       = chk_noasgn.Checked;
     mid.mem            = (int)nmr_memory.Value;
     mid.mem_unit       = cmb_memory.Text;
     mid.theory         = cmb_theory.Text;
     mid.basis          = cmb_basis.Text;
     mid.star           = cmb_star.Text;
     mid.isnosymm       = chk_mnosymm.Checked;
     mid.charge         = (int)nmr_charge.Value;
     mid.spin           = (int)nmr_spin.Value;
     mid.genfile_opt    = chk_isopt.Checked;
     mid.genfile_freq   = chk_isfreq.Checked;
     mid.genfile_irc    = chk_isirc.Checked;
     mid.genfile_nbo    = chk_isnbo.Checked;
     mid.genfile_td     = chk_td.Checked;
     mid.genfile_ct     = chk_iscustom.Checked;
     // symbols
     mid.symbols = dic_symbol;
     // scf
     mid.scf = scfsetting;
     // iop
     mid.iop = iopsetting;
     // opt
     mid.lockpos      = (txb_lockpos.Text.Split(new char[] { ',', '/' })).ToList();
     mid.optcyc       = (int)nmr_optcyc.Value;
     mid.opt_fc       = cmb_opt_fc.Text;
     mid.istransition = chk_transition.Checked;
     // freq
     mid.freq_mode       = cmb_freqmode.Text;
     mid.freq_containopt = (mid.genfile_opt && mid.genfile_freq && chk_conopt.Checked);
     // irc
     mid.ircforcemode     = cmb_ircfcmode.Text;
     mid.ircmaxpoint      = (int)nmr_ircmaxpoint.Value;
     mid.ircisgendualfile = chk_gendual.Checked;
     // td
     mid.td_calctype = cmb_td_clmode.Text;
     mid.td_nstate   = (int)num_td_nstate.Value;
     mid.td_density  = cmb_td_dens.Text;
     // custom
     mid.ct_string = custom_str;
 }
Exemplo n.º 10
0
        public override string output_addition(makeinpdata md, setting st)
        {
            var rst =
                valueset("pop", "reg") + "\n" +
                valueset("opt",
                         "maxcycle=" + md.optcyc,
                         md.opt_fc,
                         (md.istransition ? "ts,noeigentest" : ""),
                         md.inputdata.GetTypeStr()
                         ) + "\n" +
                (md.freq_containopt ? valueset("freq", md.freq_mode) + "\n" : "") +
                "";

            return(rst);
        }
Exemplo n.º 11
0
        // wordpad open
        private void fileopen_innotepad_Click(object sender, EventArgs e)
        {
            var issel = (cmb_editlist.SelectedIndex >= 0);

            if (!issel)
            {
                return;
            }
            foreach (var inp in outputs)
            {
                if (inp.IdentifyName == cmb_editlist.Text)
                {
                    var mid = new makeinpdata();
                    midApply(ref mid);
                    System.Diagnostics.Process.Start("wordpad.exe", String.Format("\"{0}\"", inp.outputPath(mid)));
                }
            }
        }
Exemplo n.º 12
0
        // generate .inp file
        private void generateInputFile()
        {
            if (!checkInputData())
            {
                return;
            }
            var rst = true;
            var mid = new makeinpdata();

            midApply(ref mid);
            foreach (var inp in outputs)
            {
                if (inp.generateCheck(mid))
                {
                    if (inp.isExistGenerateFile(mid))
                    {
                        var drst = MessageBox.Show(inp.genfilename(mid) + inp.Extension + "は既に存在するファイルです。上書きしますか?",
                                                   "Warning", MessageBoxButtons.YesNoCancel);
                        switch (drst)
                        {
                        case DialogResult.Yes:
                            rst = rst && inp.writefile(mid, myst);
                            break;

                        case DialogResult.No:
                            continue;

                        case DialogResult.Cancel:
                            return;
                        }
                    }
                    else
                    {
                        rst = rst && inp.writefile(mid, myst);
                    }
                }
            }
            if (rst)
            {
                MessageBox.Show("Save Success.", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information);
                myst.latestData = mid;
            }
        }
Exemplo n.º 13
0
        // view-file
        private void cmb_editlist_SelectedIndexChanged(object sender, EventArgs e)
        {
            var issel = (cmb_editlist.SelectedIndex >= 0);

            if (!issel)
            {
                return;
            }
            foreach (var inp in outputs)
            {
                if (inp.IdentifyName == cmb_editlist.Text)
                {
                    var mid = new makeinpdata();
                    midApply(ref mid);
                    var op = inp.output(mid, myst);
                    txb_viewfile.Text          = op.Replace("\n", "\r\n");
                    fileopen_innotepad.Enabled = inp.isExistGenerateFile(mid);
                }
            }
        }
Exemplo n.º 14
0
        private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            // datacheck
            if (!inputData.IsDataExist && !isUseCheckfile)
            {
                return;
            }
            var tpagenum   = tabControl1.TabCount;
            var tpagenow   = tabControl1.SelectedIndex;
            var islastpage = (tpagenow >= tpagenum - 1);
            var iseditpage = islastpage;

            if (iseditpage)
            {
                // temp-inpdata create
                makeinpdata mid = new makeinpdata();
                midApply(ref mid);
                // combobox item-add
                cmb_editlist.Items.Clear();
                foreach (var inp in outputs)
                {
                    if (inp.generateCheck(mid))
                    {
                        cmb_editlist.Items.Add(inp.IdentifyName);
                    }
                }
                txb_viewfile.Text          = "";
                cmb_editlist.SelectedIndex = -1;
            }
            // enable check
            tlp_opt.Enabled    = chk_isopt.Checked;
            tlp_freq.Enabled   = chk_isfreq.Checked;
            tlp_irc.Enabled    = chk_isirc.Checked;
            tlp_td.Enabled     = chk_td.Checked;
            chk_conopt.Enabled = (chk_isopt.Checked && chk_isfreq.Checked);
        }
Exemplo n.º 15
0
 public override string output_addition(makeinpdata md, setting st)
 {
     return(md.ct_string.Length > 0 ? md.ct_string + "\n" : "");
 }
Exemplo n.º 16
0
 public override bool generateCheck(makeinpdata md)
 {
     return(md.genfile_ct);
 }
Exemplo n.º 17
0
 public override string genscrfilename(makeinpdata md)
 {
     return(md.name);
 }
Exemplo n.º 18
0
 public string getmethodabst(makeinpdata md)
 {
     return(md.GetMethodName().Split(new[] { ' ', ',', '\t' })[0]);
 }
Exemplo n.º 19
0
 // function
 public override string output_before(ref makeinpdata md, ref setting st)
 {
     md.no_scf_output  = true;
     md.isusecheckfile = false;
     return("");
 }
Exemplo n.º 20
0
 public override string output_after(ref makeinpdata md, ref setting st)
 {
     return("\n" + "$nbo bndidx $end" + "\n");
 }
Exemplo n.º 21
0
 public override string genfilename(makeinpdata md)
 {
     return(md.name + "_nbo");
 }
Exemplo n.º 22
0
 public bool isExistGenerateFile(makeinpdata md)
 {
     return(File.Exists(outputPath(md)));
 }
Exemplo n.º 23
0
 public string outputPath(makeinpdata md)
 {
     return(md.location + "/" + this.genfilename(md) + OptionName + Extension);
 }
Exemplo n.º 24
0
 public virtual string output_after(ref makeinpdata md, ref setting st)
 {
     return("");
 }
Exemplo n.º 25
0
 // function
 public override string output_before(ref makeinpdata md, ref setting st)
 {
     md.no_scf_output = true;
     return("");
 }
Exemplo n.º 26
0
 public override bool generateCheck(makeinpdata md)
 {
     return(md.genfile_irc && md.ircisgendualfile);
 }
Exemplo n.º 27
0
 public abstract bool generateCheck(makeinpdata md);
Exemplo n.º 28
0
 public override bool generateCheck(makeinpdata md)
 {
     return(md.genfile_freq && !md.freq_containopt);
 }
Exemplo n.º 29
0
 public abstract string genscrfilename(makeinpdata md);
Exemplo n.º 30
0
 public abstract string output_addition(makeinpdata md, setting st);