<commit_before>
//BRENTAN: Add support for fluids and gases
var SwiftCalcsObject = P(function(_) {
  _.error = false;
  _.warn  = false;
  // Set methodList and propertyList in init (can't define on a classwide basis here)
  /*
  Error handling
  */
  _.setError = function(error) {
    this.error = error;
    return this;
  }
  _.setWarning = function(warn) {
    this.warn = warn;
    return this;
  }
  _.clearState = function() {
    this.error = false;
    this.warn = false;
  }
  _.clone = function() {
    return this;
  }
  _.toString = function() {
    return "OVERRIDE ME";
  }
});
var secondaryNames = {
  elasticModulus: 'E',
  density: 'rho',
  poissonRatio: 'nu',
  electricalConductivity: 'kappa',
  shearModulus: 'G',
  heatCapacity: 'C',
  proofStrength: 'sigma_y',
  tensileStrength: 'TS',
  thermalConductivity: 'k',
  thermalDiffusivity: 'alpha',
  thermalExpansion: 'alpha_V'
}
var Material = P(SwiftCalcsObject, function(_, super_) {
  /* 
  This is a generic material data type.  It is 'stupid' in that it has no internal 
  logic or functionality beyond returning the constant values supplied through the input
  To initialize, pass a hash with the following structure:
  {
    name: name,
    full_name: "Full Name with Spaces and Illegals ()",
    properties: [
      { name: name, value: value, unit: unit },
      ...
    ]
  }
  */
  _.methodList = [];
  _.init = function(data) {
    this.name = data.name;
    this.full_name = data.full_name;
    this.inputs = data;
    var len = data.properties.length;
    var propertyList = [];
    for(var i = 0; i < len; i++) {
      if(typeof secondaryNames[data.properties[i].name] !== 'undefined') {
        this[secondaryNames[data.properties[i].name]] = '(' + data.properties[i].value + ' * ' + data.properties[i].unit + ')';
        propertyList.push(secondaryNames[data.properties[i].name]);
      }
      this[data.properties[i].name] = '(' + data.properties[i].value + ' * ' + data.properties[i].unit + ')';
      propertyList.push(data.properties[i].name);
    }
    this.propertyList = propertyList;
  }
  _.toString = function() {
    var output = [["\\mathbf{\\underline{" + this.full_name.replace(/ /g, "\\whitespace ").replace(/%/g,"\\percentSymbol ").replace(/<sub>([a-z0-9]+)<\/sub>/gi,'_{$1}').replace(/<sup>([a-z0-9]+)<\/sup>/gi,'^{$1}').replace(/\<\/?[a-z0-9]+\/?\>/gi,'') + "}}"]];
    for(var i = 0; i < this.propertyList.length; i++)
      output.push([this.propertyList[i]]);
    output.push(["\\textcolor{#aaaaaa}{use\\whitespace variable.property\\whitespace syntax\\whitespace to}"])
    output.push(["\\textcolor{#aaaaaa}{access\\whitespace properties\\whitespace listed\\whitespace above}"])
    return toTable(output);
  }
  _.clone = function() {
    // Used when setting another variable with an object<commit_msg>Remove lots of names from property list<commit_after>
//BRENTAN: Add support for fluids and gases
var SwiftCalcsObject = P(function(_) {
  _.error = false;
  _.warn  = false;
  // Set methodList and propertyList in init (can't define on a classwide basis here)
  /*
  Error handling
  */
  _.setError = function(error) {
    this.error = error;
    return this;
  }
  _.setWarning = function(warn) {
    this.warn = warn;
    return this;
  }
  _.clearState = function() {
    this.error = false;
    this.warn = false;
  }
  _.clone = function() {
    return this;
  }
  _.toString = function() {
    return "OVERRIDE ME";
  }
});
var secondaryNames = {
  elasticModulus: 'E',
  density: 'rho',
  poissonRatio: 'nu',
  electricalConductivity: 'kappa',
  shearModulus: 'G',
  heatCapacity: 'C',
  proofStrength: 'sigma_y',
  tensileStrength: 'TS',
  thermalConductivity: 'k',
  thermalDiffusivity: 'alpha',
  thermalExpansion: 'alpha_V'
}
var Material = P(SwiftCalcsObject, function(_, super_) {
  /* 
  This is a generic material data type.  It is 'stupid' in that it has no internal 
  logic or functionality beyond returning the constant values supplied through the input
  To initialize, pass a hash with the following structure:
  {
    name: name,
    full_name: "Full Name with Spaces and Illegals ()",
    properties: [
      { name: name, value: value, unit: unit },
      ...
    ]
  }
  */
  _.methodList = [];
  _.init = function(data) {
    this.name = data.name;
    this.full_name = data.full_name;
    this.inputs = data;
    var len = data.properties.length;
    var propertyList = [];
    for(var i = 0; i < len; i++) {
      if(typeof secondaryNames[data.properties[i].name] !== 'undefined') {
        this[secondaryNames[data.properties[i].name]] = '(' + data.properties[i].value + ' * ' + data.properties[i].unit + ')';
        propertyList.push(secondaryNames[data.properties[i].name]);
      }
      this[data.properties[i].name] = '(' + data.properties[i].value + ' * ' + data.properties[i].unit + ')';
      propertyList.push(data.properties[i].name);
    }
    this.propertyList = propertyList;
  }
  _.toString = function() {
    var output = [["\\mathbf{\\underline{" + this.full_name.replace(/ /g, "\\whitespace ").replace(/%/g,"\\percentSymbol ").replace(/<sub>([a-z0-9]+)<\/sub>/gi,'_{$1}').replace(/<sup>([a-z0-9]+)<\/sup>/gi,'^{$1}').replace(/\<\/?[a-z0-9]+\/?\>/gi,'') + "}}"]];
    for(var i = 0; i < this.propertyList.length; i++) {
      if(typeof secondaryNames[this.propertyList[i]] !== 'undefined')
        output.push([this.propertyList[i]]);
    }
    output.push(["\\textcolor{#aaaaaa}{use\\whitespace variable:property\\whitespace syntax\\whitespace to}"])
    output.push(["\\textcolor{#aaaaaa}{access\\whitespace properties\\whitespace listed\\whitespace above}"])
    return toTable(output);
  }
  _.clone = function() {
    // Used when setting another variable with an object
{'fraction_non_alphanumeric': 0.17276210379658655, 'fraction_numerical': 0.0034831069313827935, 'mean_word_length': 3.2259013980868287, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2451944', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1899, 'n_words': 426}