<commit_before>


#include "FemusInit.hpp"
#include "MultiLevelProblem.hpp"
#include "VTKWriter.hpp"
#include "TransientSystem.hpp"
#include "NonLinearImplicitSystem.hpp"
#include "Marker.hpp"
#include "Line.hpp"

#include "Fluid.hpp"
#include "Solid.hpp"
#include "Parameter.hpp"

#include "NumericVector.hpp"
#include "adept.h"

#include "../include/mpmFem.hpp"

using namespace femus;

double DT = 0.01;

double SetVariableTimeStep(const double time) {
  double dt =  DT;
  return dt;
}

bool SetBoundaryCondition(const std::vector < double >& x, const char name[], double& value, const int facename, const double time) {
  bool test = 1; //dirichlet
  value = 0.;
  
  if(!strcmp(name, "DY")) {
    if(3 == facename || 4 == facename) {
      test = 0;
      value = 0;
    }
  }
  else if(!strcmp(name, "DX")) {
    if(2 == facename) {
      test = 0;
      value = 0;
    }
  }
  
  return test;
  
}

int main(int argc, char** args) {
  
  // init Petsc-MPI communicator
  FemusInit mpinit(argc, args, MPI_COMM_WORLD);
  
  std::string soft = "soft";
  std::string  medium = "medium";
  std::string  stiff = "stiff";
  
  std::string  material[3] ={soft,medium,stiff};
  
  std::map < std::pair < std::string, unsigned > , double > YC; 
  
  YC[std::make_pair (soft, 2u)] = 0.15;
  YC[std::make_pair (soft, 3u)] = 0.1;
  YC[std::make_pair (soft, 4u)] = 0.05;
  YC[std::make_pair (soft, 5u)] = 0.025;  
  
  YC[std::make_pair (medium, 2u)] = 0.15;
  YC[std::make_pair (medium, 3u)] = 0.1;
  YC[std::make_pair (medium, 4u)] = 0.05;
  YC[std::make_pair (medium, 5u)] = 0.025;  
  
  YC[std::make_pair (stiff, 2u)] = 0.15;
  YC[std::make_pair (stiff, 3u)] = 0.1;
  YC[std::make_pair (stiff, 4u)] = 0.05;
  YC[std::make_pair (stiff, 5u)] = 0.025;  
  
  std::map < std::pair < std::string, unsigned > , double > YM1; 
  
  YM1[std::make_pair (soft, 2u)] = 4.2 * 1.e5;
  YM1[std::make_pair (soft, 3u)] = 4.2 * 1.e5;
  YM1[std::make_pair (soft, 4u)] = 4.2 * 1.e5;
  YM1[std::make_pair (soft, 5u)] = 4.2 * 1.e5;
  
  YM1[std::make_pair (medium, 2u)] = 4.2 * 1.e5;
  YM1[std::make_pair (medium, 3u)] = 4.2 * 1.e5;
  YM1[std::make_pair (medium, 4u)] = 4.2 * 1.e5;
  YM1[std::make_pair (medium, 5u)] = 4.2 * 1.e5;
  
  YM1[std::make_pair (stiff, 2u)] = 4.2 * 1.e6;
  YM1[std::make_pair (stiff, 3u)] = 4.2 * 1.e6;
  YM1[std::make_pair (stiff, 4u)] = 4.2 * 1.e6;
  YM1[std::make_pair (stiff, 5u)] = 4.2 * 1.e6;  
  
  
  std::map < std::pair < std::string, unsigned > , double > YM2; 
  
  YM2[std::make_pair (soft, 2u)] = 4.2 * 1.e5;
  YM2[std::make_pair (soft, 3u)] = 4.2 * 1.e5;
  YM2[std::make_pair (soft, 4u)] = 4.2 * 1.e5;
  YM2[std::make_pair (soft, 5u)] = 4.2 * 1.e5;
  
  YM2[std::make_pair (medium, 2u)] = 4.2 * 1.e6;
  YM2[std::make_pair (medium, 3u)] = 4.2 * 1.e6;
  YM2[std::make_pair (medium, 4u)] = 4.2 * 1.e6;
  YM2[std::make_pair (medium, 5u)] = 4.2 * 1.e6;
  
  YM2[std::make_pair (stiff, 2u)] = 4.2 * 1.e7;
  YM2[std::make_pair (stiff, 3u)] = 4.2 * 1.e7;
  YM2[std::make_pair (stiff, 4u)] = 4.2 * 1.e7;
  YM2[std::make_pair (stiff, 5u)] = 4.2 * 1.e7;   
  
  std::map < std::pair < std::string, unsigned > , double > NF; 
  
  NF[std::make_pair (soft, 2u)] = 0.;
  NF[std::make_pair (soft, 3u)] = 0.;
  NF[std::make_pair (soft, 4u)] = 0.;
  NF[std::make_pair (soft, 5u)] = 0.1;
  
  NF[std::make_pair (medium, 2u)] = 0.;
  NF[std::make_pair (medium, 3u)] = 0.;
  NF[std::make_pair (medium, 4u)] = 0.;
  NF[std::make_pair (medium, 5u)] = 0.1;

  NF[std::make_pair (stiff, 2u)] = 0.;
  NF[std::make_pair (stiff, 3u)] = 0.;
  NF[std::make_pair (stiff, 4u)] = 0.;
  NF[std::make_pair (stiff, 5u)] = 0.1;
  
  std::pair <std::string, unsigned > simulation;
  
  
  
  
  unsigned timestep0 = 50;
  unsigned n_timesteps = 250 + timestep0;
    
  std::vector < std::map < std::pair < std::string, unsigned > , double > > CM(n_timesteps +1 - timestep0); <commit_msg>runnig ex3<commit_after>


#include "FemusInit.hpp"
#include "MultiLevelProblem.hpp"
#include "VTKWriter.hpp"
#include "TransientSystem.hpp"
#include "NonLinearImplicitSystem.hpp"
#include "Marker.hpp"
#include "Line.hpp"

#include "Fluid.hpp"
#include "Solid.hpp"
#include "Parameter.hpp"

#include "NumericVector.hpp"
#include "adept.h"

#include "../include/mpmFem.hpp"

using namespace femus;

double DT = 0.01;

double SetVariableTimeStep(const double time) {
  double dt =  DT;
  return dt;
}

bool SetBoundaryCondition(const std::vector < double >& x, const char name[], double& value, const int facename, const double time) {
  bool test = 1; //dirichlet
  value = 0.;
  
  if(!strcmp(name, "DY")) {
    if(3 == facename || 4 == facename) {
      test = 0;
      value = 0;
    }
  }
  else if(!strcmp(name, "DX")) {
    if(2 == facename) {
      test = 0;
      value = 0;
    }
  }
  
  return test;
  
}

int main(int argc, char** args) {
  
  // init Petsc-MPI communicator
  FemusInit mpinit(argc, args, MPI_COMM_WORLD);
  
  std::string soft = "soft";
  std::string  medium = "medium";
  std::string  stiff = "stiff";
  
  std::string  material[3] ={soft,medium,stiff};
  
  std::map < std::pair < std::string, unsigned > , double > YC; 
  
  YC[std::make_pair (soft, 2u)] = 0.15;
  YC[std::make_pair (soft, 3u)] = 0.1;
  YC[std::make_pair (soft, 4u)] = 0.05;
  YC[std::make_pair (soft, 5u)] = 0.025;  
  
  YC[std::make_pair (medium, 2u)] = 0.15;
  YC[std::make_pair (medium, 3u)] = 0.1;
  YC[std::make_pair (medium, 4u)] = 0.05;
  YC[std::make_pair (medium, 5u)] = 0.025;  
  
  YC[std::make_pair (stiff, 2u)] = 0.15;
  YC[std::make_pair (stiff, 3u)] = 0.1;
  YC[std::make_pair (stiff, 4u)] = 0.05;
  YC[std::make_pair (stiff, 5u)] = 0.025;  
  
  std::map < std::pair < std::string, unsigned > , double > YM1; 
  
  YM1[std::make_pair (soft, 2u)] = 4.2 * 1.e5;
  YM1[std::make_pair (soft, 3u)] = 4.2 * 1.e5;
  YM1[std::make_pair (soft, 4u)] = 4.2 * 1.e5;
  YM1[std::make_pair (soft, 5u)] = 4.2 * 1.e5;
  
  YM1[std::make_pair (medium, 2u)] = 4.2 * 1.e5;
  YM1[std::make_pair (medium, 3u)] = 4.2 * 1.e5;
  YM1[std::make_pair (medium, 4u)] = 4.2 * 1.e5;
  YM1[std::make_pair (medium, 5u)] = 4.2 * 1.e5;
  
  YM1[std::make_pair (stiff, 2u)] = 4.2 * 1.e6;
  YM1[std::make_pair (stiff, 3u)] = 4.2 * 1.e6;
  YM1[std::make_pair (stiff, 4u)] = 4.2 * 1.e6;
  YM1[std::make_pair (stiff, 5u)] = 4.2 * 1.e6;  
  
  
  std::map < std::pair < std::string, unsigned > , double > YM2; 
  
  YM2[std::make_pair (soft, 2u)] = 4.2 * 1.e5;
  YM2[std::make_pair (soft, 3u)] = 4.2 * 1.e5;
  YM2[std::make_pair (soft, 4u)] = 4.2 * 1.e5;
  YM2[std::make_pair (soft, 5u)] = 4.2 * 1.e5;
  
  YM2[std::make_pair (medium, 2u)] = 4.2 * 1.e6;
  YM2[std::make_pair (medium, 3u)] = 4.2 * 1.e6;
  YM2[std::make_pair (medium, 4u)] = 4.2 * 1.e6;
  YM2[std::make_pair (medium, 5u)] = 4.2 * 1.e6;
  
  YM2[std::make_pair (stiff, 2u)] = 4.2 * 1.e7;
  YM2[std::make_pair (stiff, 3u)] = 4.2 * 1.e7;
  YM2[std::make_pair (stiff, 4u)] = 4.2 * 1.e7;
  YM2[std::make_pair (stiff, 5u)] = 4.2 * 1.e7;   
  
  std::map < std::pair < std::string, unsigned > , double > NF; 
  
  NF[std::make_pair (soft, 2u)] = 0.;
  NF[std::make_pair (soft, 3u)] = 0.;
  NF[std::make_pair (soft, 4u)] = 0.;
  NF[std::make_pair (soft, 5u)] = 0.3;
  
  NF[std::make_pair (medium, 2u)] = 0.;
  NF[std::make_pair (medium, 3u)] = 0.;
  NF[std::make_pair (medium, 4u)] = 0.;
  NF[std::make_pair (medium, 5u)] = 0.3;

  NF[std::make_pair (stiff, 2u)] = 0.;
  NF[std::make_pair (stiff, 3u)] = 0.;
  NF[std::make_pair (stiff, 4u)] = 0.;
  NF[std::make_pair (stiff, 5u)] = 0.3;
  
  std::pair <std::string, unsigned > simulation;
  
  
  
  
  unsigned timestep0 = 50;
  unsigned n_timesteps = 250 + timestep0;
    
  std::vector < std::map < std::pair < std::string, unsigned > , double > > CM(n_timesteps +1 - timestep0); 
{'fraction_non_alphanumeric': 0.2052475119555383, 'fraction_numerical': 0.06294429365387101, 'mean_word_length': 3.298888888888889, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '4869766', 'n_tokens_mistral': 3928, 'n_tokens_neox': 3547, 'n_words': 739}