Commit 11bdf6e8 authored by Daniel Brown's avatar Daniel Brown

Switching off signal calculation when doing locks, speeds up some simulations...

Switching off signal calculation when doing locks, speeds up some simulations significantly as the signal matrix output is never used for DC lockin
parent 2ee700f8
......@@ -288,7 +288,7 @@ void compute_data(void) {
update_fields = true;
tune_parameters();
data_point_new();
data_point_new(true);
if (inter.debug & 8192) {
//dump_matrix(STANDARD, "stdout");
......@@ -754,7 +754,7 @@ void _fill_dioptre_mod_knn(signal_t *signal, double Px, double Py, node_t* nodes
double phase = f_sig->order * signal->phase;
double factor = signal->amplitude * EPSILON * 0.5; //Epsilon/2 for fsig
for(i=0; i<4; i++){
for(i=0; i<1; i++){
node_t *node_from = nodes_options[i][0];
node_t *node_to = nodes_options[i][1];
......@@ -2038,7 +2038,7 @@ int x_count = 0;
* This differs from the old data_point routine which handles frequencies
* sequentially instead of solving all frequencies at the same time.
*/
void data_point_new(){
void data_point_new(int do_sig){
//int tid = startTimer("DATAPOINT");
// ensure that the fsig variables are always sensible
......@@ -2076,7 +2076,7 @@ void data_point_new(){
factor_matrix(STANDARD);
clear_rhs(STANDARD);
int using_sig_qcorr = inter.num_signal_freqs > 0;
int using_sig_qcorr = inter.num_signal_freqs > 0 && do_sig;
if(using_sig_qcorr){
// clear the rhs vector as we will add to it in the next loop for the laser frequency modulation...
......@@ -3748,7 +3748,7 @@ double fn_minimizer(double x) {
compute_puts();
rebuild_all();
data_point_new();
data_point_new(true);
fill_detectors();
//--------------------------------
......@@ -3860,7 +3860,7 @@ void tune_parameters(void) {
set_progress_action_text("Calculating");
print_progress(init.num_points_total, current_point_tot); // print progress percents
data_point_new();
data_point_new(false);
fill_detectors();
// compute_functions();
......@@ -3916,6 +3916,9 @@ void tune_parameters(void) {
subcounter++;
}
data_point_new(true);
fill_detectors();
inter.startlock++;
if (inter.startlock > 1 && init.sequential & 4) {
init.sequential = 0;
......@@ -3972,7 +3975,7 @@ void tune_parameters(void) {
compute_puts();
rebuild_all();
data_point_new();
data_point_new(true);
fill_detectors();
}
......@@ -4232,7 +4235,7 @@ void write_data_header(FILE *ofp) {
void x0_out(void) {
// set parameters from command
data_point_new();
data_point_new(true);
fill_detectors();
......
......@@ -78,7 +78,7 @@ void create_data_array(complex_t *sol);
void compute_result(complex_t *z_tmp);
complex_t xyamp(node_t *sig_node, complex_t q);
void data_point_new(void);
void data_point_new(int);
void fill_detectors(void);
complex_t beam_shape(int detector_index);
......
......@@ -692,7 +692,6 @@ void read_file(FILE *fp) {
read_init_dummy(fp, 0);
}
else if (strncasecmp(s, "shot ", 5) == 0) {
// if (!inter.beam.set) // ignoring other detetcors if beam analyser is set!
read_shot(s);
} else if (strncasecmp(s, "qshot ", 6) == 0
|| strncasecmp(s, "qshotS ", 7) == 0
......@@ -1674,7 +1673,11 @@ void read_mirror(const char *command_string, int mode) {
// set the transmissivity, reflectivity and loss of the mirror
mirror->T = transmittance;
mirror->R = 1.0 - mirror->T - loss;
assert(mirror->R >= 0.0); // check to make sure the reflectivity >= 0
if(mirror->R < 0.0 && fabs(mirror->R) > 1e-15){ // check to make sure the reflectivity >= 0
gerror("Mirror %s has a reflectivity %g, which should be zero.", mirror->name, mirror->R);
}
// reset the reflectivity as is done in read_beamsplitter()
if (mirror->R < 0.0) {
mirror->R = 0.0;
......
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