Commit e97db770 authored by Andreas Freise's avatar Andreas Freise

Merge branch 'develop' of gitmaster.atlas.aei.uni-hannover.de:finesse/finesse into develop

parents 127112a3 53a4211b
......@@ -120,7 +120,10 @@ Unix/OS X:
Windows:
Firstly you must move the FINESSE folder to a location on
your computer (such as "C:\Program Files\"). Then double click the
your computer where you want to store it. Becareful putting it in a
system wide directory such as 'Program Files' as you will require
adminstrator rights to write to such a location. Once move to the
desired location you should double click the
`install.bat` file. Running this will bring up a command window
to update your PATH variables. After this has been run you must
NOT move this Finesse folder, as the system PATH variable has been
......
......@@ -524,10 +524,11 @@ int main(int argc, char *argv[]) {
strcat(vglobal.output_fname, ".out");
strcpy(vglobal.gnuplot_fname, inter.basename);
strcat(vglobal.gnuplot_fname, ".gnu");
#ifdef OSWIN
strcpy(vglobal.gnuplot_test_fname, ".");
strcat(vglobal.gnuplot_test_fname, inter.basename);
strcat(vglobal.gnuplot_test_fname, ".tmp");
#endif
strcpy(vglobal.log_fname, inter.basename);
strcat(vglobal.log_fname, ".log");
} else if (argc == 3) { // the input and output file names are specified...
......@@ -539,9 +540,11 @@ int main(int argc, char *argv[]) {
strcpy(vglobal.output_fname, argv[num_options + 2]);
strcpy(vglobal.gnuplot_fname, inter.basename);
strcat(vglobal.gnuplot_fname, ".gnu");
#ifdef OSWIN
strcpy(vglobal.gnuplot_test_fname, ".");
strcat(vglobal.gnuplot_test_fname, inter.basename);
strcat(vglobal.gnuplot_test_fname, ".tmp");
#endif
strcpy(vglobal.log_fname, inter.basename);
strcat(vglobal.log_fname, ".log");
} else if (argc == 4) { // input, output and gnuplot file names are given...
......@@ -552,9 +555,11 @@ int main(int argc, char *argv[]) {
strcpy(vglobal.input_fname, argv[num_options + 1]);
strcpy(vglobal.output_fname, argv[num_options + 2]);
strcpy(vglobal.gnuplot_fname, argv[num_options + 3]);
#ifdef OSWIN
strcpy(vglobal.gnuplot_test_fname, ".");
strcat(vglobal.gnuplot_test_fname, argv[num_options + 3]);
strcat(vglobal.gnuplot_test_fname, ".tmp");
#endif
strcpy(vglobal.log_fname, inter.basename);
strcat(vglobal.log_fname, ".log");
}
......
......@@ -2087,7 +2087,9 @@ typedef struct global_var {
char input_fname[FNAME_LEN]; //!< input file name
char output_fname[FNAME_LEN]; //!< output file name
char gnuplot_fname[FNAME_LEN]; //!< gnuplot file name
#ifdef OSWIN
char gnuplot_test_fname[FNAME_LEN]; //!< gnuplot file name
#endif
char matlab_fname[FNAME_LEN]; //!< matlab file name
char python_fname[FNAME_LEN]; //!< python file name
char log_fname[FNAME_LEN]; //!< log file name
......
......@@ -3702,13 +3702,13 @@ void x12_out(void) {
open_file_to_write_ascii(vglobal.gnuplot_fname, &gfp);
gnufile(0, gfp, tmp_out_filename, false);
fclose(gfp);
#ifdef OSWIN
if(strlen(vglobal.gnuplot_test_fname) > 0){
open_file_to_write_ascii(vglobal.gnuplot_test_fname, &gfp);
gnufile(0, gfp, tmp_out_filename, true);
fclose(gfp);
}
#endif
open_file_to_write_ascii(vglobal.matlab_fname, &mfp);
matlabfile(mfp, tmp_out_filename);
fclose(mfp);
......
......@@ -2007,9 +2007,9 @@ void my_finish(int return_value) {
fflush(stdout);
fflush(stderr);
#ifdef OSWIN
remove(vglobal.gnuplot_test_fname);
#endif
exit(return_value);
// close the log file nicely
......
......@@ -873,6 +873,12 @@ void fill_qnoise_input_matrix(){
//dump_matrix_ccs(&M_qni, "qnoise_input.dat");
}
int __sort_int(const void *a,const void*b) {
int _a = *(int*)a;
int _b = *(int*)b;
return _a - _b;
}
/**
* For all components that have been marked with the vacuum command the nodes that
* need to be computed are marked and put in a list for iterating over later.
......@@ -980,6 +986,88 @@ void init_quantum_components(){
}
}
}
// do a final sweep of all dump nodes and warn about when they are attached
// to components that might couple vacuum noise into the system but won't
node_t *node;
int n;
UT_array *comps;
utarray_new(comps, &ut_int_icd);
for(n=0; n<inter.num_nodes; n++){
node = &inter.node_list[n];
if(!node->gnd_node)
continue;
node_connections_t *nc = &inter.node_conn_list[n];
if((nc->comp_1 != NULL) && (nc->comp_2 != NULL))
bug_error("dump node attached to two components, this shouldn't happen");
if((nc->comp_1 == NULL) && (nc->comp_2 == NULL))
bug_error("dump node not attached to any components, this shouldn't happen");
void *cmp = (nc->comp_1 != NULL) ? nc->comp_1 : nc->comp_2;
int type = (nc->comp_1 != NULL) ? nc->type_1 : nc->type_2;
int foundidx = -1;
if( type == MIRROR) {
mirror_t *m = (mirror_t*) cmp;
if (m->T != 0) {
foundidx = get_component_index_from_name(m->name);
}
} else if(type == BEAMSPLITTER){
beamsplitter_t *bs = (beamsplitter_t*) cmp;
if (bs->T != 0) {
foundidx = get_component_index_from_name(bs->name);
}
// if one node and one dump node on each side with non-zero R
if(bs->R > 0 &&
((!inter.node_list[bs->node1_index].gnd_node ^ !inter.node_list[bs->node2_index].gnd_node)
|| (!inter.node_list[bs->node3_index].gnd_node ^ !inter.node_list[bs->node4_index].gnd_node))){
foundidx = get_component_index_from_name(bs->name);
}
} else if(type == LENS) {
foundidx = get_component_index_from_name(get_comp_name(type, cmp));
} else if(type == DIODE) {
foundidx = get_component_index_from_name(get_comp_name(type, cmp));
} else if(type == SPACE) {
foundidx = get_component_index_from_name(get_comp_name(type, cmp));
} else if(type == MODULATOR) {
foundidx = get_component_index_from_name(get_comp_name(type, cmp));
}
if(foundidx >= 0) {
utarray_sort(comps, __sort_int);
if(!utarray_find(comps, &foundidx, __sort_int)){
utarray_push_back(comps, &foundidx);
}
}
}
int *p;
if(utarray_len(comps)){
char *msg = "Found dump nodes attached to components that have non-zero transmission.\n"
" This will produce incorrect results for quantum noise calculations as noise\n"
" is lost and not injected back in. Change dump nodes to proper nodes at the\n"
" at the following components:\n";
warn(msg);
for(p=(int*)utarray_front(comps);
p!=NULL;
p=(int*)utarray_next(comps,p)) {
int type = get_component_type_decriment_index(p);
printf(" - %s\n", get_comp_name2(type, *p));
}
}
utarray_free(comps);
}
int ___a = 0;
......
......@@ -5117,7 +5117,6 @@ void read_hd_out(const char *command_string){
hd->node1_index = update_node_index_for(node1_name, EITHER_DIR);
hd->node2_index = update_node_index_for(node2_name, EITHER_DIR);
//output_data->node_index = NOT_FOUND;
// storing first node rather than NOT_FOUND as it causes problems later
output_data->node_index = update_node_index_for(node1_name, EITHER_DIR);
output_data->node_reduced_index = NOT_FOUND;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment