Example #1
0
    def _BuildVariableList(self):
        with tf.name_scope("Variables"):
            with tf.name_scope("LinearElasticModelVariables"):
                var_type_le = getattr(ConLawL.ModelVariables(), self.le_model_type)
                self.vars_le = var_type_le(self.init_var_values).Variables
                self.vars_le_plot = var_type_le(self.init_var_values).Vars4Print
                self.vars_le_limit = var_type_le.ConstrainVariables(self.vars_le, self.init_var_values)
            
            with tf.name_scope("DamageModelVariables"):
                if self.bezier_energy_approach == "On" and self.bezier_applied =="Yes":
                    var_type_nl = getattr(ConLawL.ModelVariables(), self.damage_model_type + "WithFractureEnergy")
                    self.vars_nl_plot = var_type_nl(self.init_var_values).Vars4Print
                    if bezier_train_controllers =="No":
                        self.vars_nl_plot = self.vars_nl_plot[:-3]
                elif self.bezier_energy_approach =="Off" and self.bezier_applied=="Yes":
                    var_type_nl = getattr(ConLawL.ModelVariables(), self.damage_model_type)
                    self.vars_nl_plot = var_type_nl(self.init_var_values).Vars4Print
                else:
                    if self.bezier_applied == "Yes":
                        print(" WARNING: Error in ModelSettings.Json !!!", "\n",\
                        "Please define the comp_energy_approach in ModelSettings.json as On or Off!")
                        sys.exit()
                    else:
                        var_type_nl = getattr(ConLawL.ModelVariables(), self.damage_model_type)
                        self.vars_nl_plot = var_type_nl(self.init_var_values).Vars4Print

                self.vars_nl = var_type_nl(self.init_var_values).Variables
            
                if self.bezier_applied == "Yes":
                    self.vars_nl_limit = var_type_nl.ConstrainVariables(self.vars_nl, self.vars_le_limit,  self.init_var_values)
                else:
                    self.vars_nl_limit = var_type_nl.ConstrainVariables(vars_nl)
Example #2
0
 def _ConstructSummaryWriter(self):
     with tf.name_scope('AllSummaries'):
         sum_writer_le = getattr(ConLawL.ModelVariables(), self.le_model_type + "Summary")
         sum_writer_le(self.vars_le_limit)
         if self.bezier_applied == "Yes" and self.bezier_energy_approach == "On":
             sum_writer_nl = getattr(ConLawL.ModelVariables(), self.damage_model_type + \
                                 "WithFractureEnergy" + "Summary")
         else:
             sum_writer_nl = getattr(ConLawL.ModelVariables(), self.damage_model_type + \
                             "Summary")
         sum_writer_nl(self.vars_nl_limit)
Example #3
0
 def _BuildVariableList(self):
     with tf.name_scope("Variables"):
         with tf.name_scope("LinearElasticModelVariables"):
             var_type_le = getattr(ConLawL.ModelVariables(),
                                   self.le_model_type)
             self.vars_le = var_type_le(self.init_var_values).Variables
             self.vars_le_plot = var_type_le(
                 self.init_var_values).Vars4Print
             self.vars_le_limit = var_type_le.ConstrainVariables(
                 self.vars_le, self.init_var_values)
Example #4
0
 def _ConstructSummaryWriter(self):
     with tf.name_scope('AllSummaries'):
         sum_writer_le = getattr(ConLawL.ModelVariables(),
                                 self.le_model_type + "Summary")
         sum_writer_le(self.vars_le_limit)