Skip to content
Extraits de code Groupes Projets
Valider 60b40e28 rédigé par Youssef SAMLALI's avatar Youssef SAMLALI
Parcourir les fichiers

makefile & folders organisation

parent f97a10a3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
# PAP # PAP - Projet equation de la chaleur
## CAZENAVE Clement & SAMLALI Youssef
...@@ -37,7 +37,7 @@ class Materiaux ...@@ -37,7 +37,7 @@ class Materiaux
}; };
int** settab(Materiaux mat, int m, int n , int u0,double T, double L, double f); int** settab(Materiaux mat, int m, int n , int u0,double T, double f);
#endif #endif
// A simple call_scilab example
#include <stdio.h> /* stderr */
#include <stdlib.h>
#include "call_scilab.h" /* Provide functions to call Scilab engine */
/* Provide functions to access to the memory of Scilab */
// Filename: simple_call_scilab.c
int main(void)
{
/****** INITIALIZATION **********/
#ifdef _MSC_VER
if ( StartScilab(NULL,NULL,NULL) == FALSE )
#else
if ( StartScilab(getenv("SCI"),NULL,NULL) == FALSE )
#endif
{
fprintf(stderr,"Error while calling StartScilab\n");
return -1;
}
/****** ACTUAL Scilab TASKS *******/
SendScilabJob("myMatrix=['sample','for the help']");
SendScilabJob("disp(myMatrix);"); // Will display !sample for the help !
SendScilabJob("disp([2,3]+[-44,39]);"); // Will display - 42. 42.
/****** TERMINATION **********/
if ( TerminateScilab(NULL) == FALSE ) {
fprintf(stderr,"Error while calling TerminateScilab\n");
return -2;
}
return 0;
}
all: src
src:
$(MAKE) -C src
.PHONY: clean src
clean:
$(MAKE) -C src clean
#include <iostream>
#include <limits>
#include <iomanip>
#include "../includes/tab.h"
using namespace std;
int main(){
Materiaux cuivre = Materiaux(389, 8940,380);
Materiaux fer= Materiaux (80.2,7874,440);
Materiaux verre= Materiaux(1.2,2530,840);
Materiaux polystyrene= Materiaux(0.1,1040,1200);
int ** u_cuivre = settab(cuivre, 100,100,253,1,600);
int ** u_fer = settab(fer, 100,100,253,1,600);
int ** u_verre = settab(verre, 100,100,253,1,600);
int ** u_polystyrene = settab(polystyrene, 100,100,253,1,600);
cout<<u_cuivre<<u_fer<<u_polystyrene<<u_verre<<endl;
return 0;
}
CC = g++
CPPFLAGS = -std=c++11 -Wall -Wextra -Werror
INCLUDES=../includes
TARGET = ../main
OBJS = main.o tab.o
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) $^ -o $@
%.o: %.cpp $(INCLUDES)%.h
$(CC) $(CPPFLAGS) $< -c -o $@ $<
.PHONY: clean
clean:
rm -f $(OBJS)
rm -f $(TARGET)
#include <iostream> #include <iostream>
#include <limits> #include <limits>
#include <iomanip> #include <iomanip>
#include "tab.h" #include "../includes/tab.h"
using namespace std; using namespace std;
typedef std::numeric_limits< double > dbl; typedef std::numeric_limits< double > dbl;
...@@ -15,7 +15,7 @@ Materiaux::Materiaux(double lambda, double kho, double c) ...@@ -15,7 +15,7 @@ Materiaux::Materiaux(double lambda, double kho, double c)
int** settab(Materiaux mat, int m, int n , int u0,double T, double L, double f) int** settab(Materiaux mat, int m, int n , int u0,double T,double f)
{ {
double dt, dx; double dt, dx;
dt= T/100.; dt= T/100.;
...@@ -61,14 +61,3 @@ int** settab(Materiaux mat, int m, int n , int u0,double T, double L, double f) ...@@ -61,14 +61,3 @@ int** settab(Materiaux mat, int m, int n , int u0,double T, double L, double f)
} }
int main(){
Materiaux cuivre = Materiaux(389, 8940,380);
Materiaux fer= Materiaux (80.2,7874,440);
Materiaux verre= Materiaux(1.2,2530,840);
Materiaux polystyrene= Materiaux(0.1,1040,1200);
int ** s = settab(cuivre, 100,100,253,16,1,600);
return 0;
}
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter